Sale
What it is
A sale is the primary payment object that represents an amount to be collected. It contains the commercial context of a payment, such as amount, currency, reference, customer, allowed payment methods, and related transactions.
Why it exists
It exists to model the payment intent at business level. A sale lets you create, retrieve, search, and cancel payment flows without working directly at transaction level. The sale will serve as an easy-to-use entity that represents the state of a sale / order / invoice. This is done by combining all related:
- (Partial) Transactions
- Refunds
- Chargebacks / Reversals
How it relates to other concepts
A sale can belong to a store and can include a customer. It can produce one or more Transactions over time. A sale may also use specific payment methods, terminal options, shipping data, order lines, and Metadata. Webhooks and Applications may react to events around a sale.
Amount Breakdown
The easiest way to create a sale for a certain amount is to only provide the currency and total amount. However, when creating a sale there is an option to also provide an amount breakdown. For some payment methods this is required, for others it serves as useful reporting information. The breakdown consists of the following amounts:
| Name | Explanation |
|---|---|
| Base Amount | The base amount of the sale |
| VAT Amount | The amount of VAT that was charged for the sale |
| Shipping Fee | The shipping fee charged for the sale |
| Handling Fee | The handling fee charged for the sale |
| Discount Amount | A discount amount for the sale. |
The total amount of the Sale should be equal to the sum of the amounts in the breakdown. This means that amounts that decrease the total Sale amount, like the Discount Amount, should be provided as negative values.
Updated 10 days ago