About the Receipts API

The Receipts API provides functionality for creating receipts, enabling you to generate professional transaction documentation that aligns with business requirements.

Receipt numbering

The number displayed on each receipt is made up of 3 parts: a prefix, a sequential number, and a suffix. For example, a business might use a prefix that increments annually, combined with a suffix showing the current year, while the sequential number increases with each new receipt.

You can manage the receipt numbering in the Receipts Settings API.

Receipt documents

Receipts include a reference to an automatically generated document that can be shared with customers. This document generation is triggered automatically upon receipt creation, and has the following generation statuses:

  • Processing: Generation is in progress. You can call Get Receipt after 6-10 seconds to get the status.
  • Available: Generation was successful. You can downloaded the document using the downloadUrl.
  • Failed: Generation failed. You can retrigger document generation by calling Regenerate Receipt Document.

Custom fields and extended fields

Each receipt supports two types of additional data fields: custom fields and extended fields.

  • Custom fields: Fields that display in the receipt's header, footer, business details, or customer information sections. These are visible on the generated receipt document.
  • Extended fields: Programmatic data fields defined within schema plugin extensions. These fields are accessible via API only and do not appear on the visible receipt.

Before you begin

It's important to note the following points before starting to code:

  • Receipts can be generated for the following:
  • In order to generate a receipt, the site must have defined business info, language, and region settings, either using the site dashboard or the Site Properties API. These will be used as defaults in case the relevant info is not provided in a receipt creation request.
  • Only one receipt can be generated per transaction (based on transactionId).
  • Receipts can be created, but not edited or deleted.

Use Cases

Terminology

  • Receipt: A static document that serves as proof of payment for a completed transaction.
  • Receipt preset: A collection of receipt configurations that define the receipt's appearance, behavior, and custom fields. Used for different business scenarios, for example, multiple locations or domains within the same site.
  • Receipt settings: Site-level configurations that control receipt numbering schemas.
Did this help?