An Order captures the details of what a customer wishes to pay for, but is at the same time acting as a state machine that goes through the process of collecting an authorization for creating payments. It is recommended to create exactly one Smartpay Order for each order or customer session in your system.

The Order transitions through multiple statuses throughout its lifetime to perform authorization flows and ultimately creates one or more payments.

Attributes
idstring
Unique identifier for the object
objectstring, value is "order"
A string representing the object’s type. Objects of the same type share the same value.
amountinteger
The amount intended to be collected through one or more Payments linked to this order. A positive integer in the smallest currency unit (e.g. 100 cents to charge $1.00 or 100 to charge $100).
createdAttimestamp
Time at which the object was created. Measured in milliseconds since the Unix epoch.
currencystring
Three-letter ISO currency code, in lowercase. Must be a supported currency.
descriptionstring
An arbitrary - ideally descriptive - long form explanation of the Order, meant to be displayed to the customer.
expiresAttimestamp
Time at which the Order expires beyond which (additional) capture of the Order is impossible. This timestamp is only set after successful authorization of the order. Measured in milliseconds since the Unix epoch.
lineItemslist of string
The IDs of the line items the customer wishes to order.
metadataobject
Set of key-value pairs that you can attach to the Order object.
paymentslist of string
The IDs of the payments created for this order.
statusstring
The status of an order.
Possible enum values
  • requires_authorization

    When the order is created and requires an authorization outcome.

  • rejected

    When the authorization of the order evaluated into rejection.

  • requires_capture

    When the authorization of the order is accepted, and there is a remaining amount for payment creation.

  • succeeded

    When the authorization of the order is accepted, and there is a remaining amount for payment creation.

  • canceled

    When the authorization of the order is accepted, and there is a remaining amount for payment creation.

referencestring
A - ideally unique - string to reference the Order (e.g. a customer ID, a cart ID, etc.) which can be used to reconcile the Session with your internal systems.
testboolean
A flag with a value false if the object exists in live mode or true if the object exists in test mode.
updatedAttimestamp
Time at which the object was last updated. Measured in milliseconds since the Unix epoch.