Payment session

A Payment session is an object representing the lifecycle of a single customer's purchase, starting from signing in or created a new cart up to completing a purchase. The Payment session contains a client secret that can be used to authenticate as the customer from the client device or frontend.

📘

Payment session lifecycle tip

We recommend create one payment session per order or customer session in your system. The id of the payment session can be used as the idempotency key for API operations.

Payment session attributes

FieldTypeDescriptionExample value
idstringUnique identifier for the payment session.9f656bb4-7e9e-450f-8cf6-647cf029454d
clientSecretstring

The client secret of this payment session.

The client secret is used to authorize Ansa API calls initiated from the client device.

ansa_cs_sandbox_+v1234512345
customerIdstringThe ID of the Customer this payment session belongs to.
createdtimestampThe timestamp (in RFC 3339 format) when the payment session and its associated client secret were created.2022-12-08T23:47:41.643Z
validUntiltimestamp

The timestamp (in RFC 3339 format) when the payment session and its associated client secret will expire.

This is typically 24 hours after created.

2022-12-09T23:47:41.643Z