A payment session is an in-progress payment transaction. It is a temporary, time-limited context created when a client initiates a payment flow.
It becomes a secure, stateful environment for completing a payment transaction. Instead of passing sensitive payment data on every request, the payment session persists transaction details. This includes the amount, currency, payment methods, and status. It exposes only the payment session identifier to the client. This reduces the risk of data exposure.
A payment session is used only with Flute Elements or Flute Checkout. The paymentSessionType field records which one:
- A Flute Checkout session is for Flute's own hosted payment page. Create one with POST /v2/payment-sessions/checkout, then redirect the customer to the returned
checkoutUrl. - A Flute Elements session is for a merchant-built UI using the Flute Elements SDK. Create one with POST /v2/payment-sessions/elements, then initialize the SDK with the returned
paymentSessionId.
Both creation endpoints return the same session object, and so does retrieving one.
The following is a common workflow for using a payment session.
- Create the payment session, as a Flute Checkout or a Flute Elements session.
- Connect through Flute Elements or Flute Checkout. This may include selecting a payment method, applying discounts or promotions, authorizing the payment, and capturing the funds. Many of these individual steps will be transparent to the client when using Flute Elements or Flute Checkout.
At each step, the payment session holds the transaction state. This means each step can update the session without resubmitting the full transaction data. If the client navigates away but later returns, the session can be retrieved by its identifier with GET /v2/payment-sessions/{{paymentSessionId}}. The flow resumes from its last state.
The paymentSessionStatus field tracks where the session stands. The session ends in one of these statuses:
Completed. The payment, or the vault for aSaveMethodsession, succeeded.paymentSessionResultcarries what it produced: the saved payment method, the charged transaction, or both.Failed. A payment attempt on the session failed. Create a new session to retry.Cancelled. The merchant canceled the session with POST /v2/payment-sessions/{{paymentSessionId}}/cancel, while it was stillCreated. A new session must be started to try again.Expired. The session'sexpiresOnpassed while it was stillCreated. A payment submitted just beforeexpiresOncan still move anExpiredsession toCompletedorFailed.
POST {{baseURL}}/v2/payment-sessions/checkout
This endpoint creates a new Flute Checkout session.
Flute hosts the payment page. Redirect the customer to the returned checkoutUrl, which is fully formed for the environment being called. The response is the full session object, the same one GET /v2/payment-sessions/{{paymentSessionId}} returns. paymentSessionResult is null until the session is Completed.
A Flute Checkout session accepts every field a Flute Elements session does, plus returnUrl, pageName, and extraFields for the hosted page. None of the hosted-page fields are accepted for a SaveMethod session.
This endpoint is idempotent. See the idempotency-key header entry. For more information, see Idempotency.
This endpoint requires a merchant API token. A partner API token is rejected with a 403 response, even if the partner has the HostedWebComponents permission. This endpoint only runs for merchant-scoped tokens. A merchant API token managed by a partner also requires that partner's account to have the HostedWebComponents permission. Otherwise, the request returns a 403 response.
See Also:
To create a Flute Elements session, see POST /v2/payment-sessions/elements.
To retrieve a payment session by id, see GET /v2/payment-sessions/{{paymentSessionId}}.
To cancel a payment session, see POST /v2/payment-sessions/{{paymentSessionId}}/cancel.
Specifies the client-generated idempotency-key.
This key is optional. We recommend using the key to prevent multiple invocations of the operation. This key makes this request safely retryable, or idempotent. If the idempotency key is not included, the call will not have idempotency protection.
A retry with the same key, made within the retention window, returns the original response verbatim. The operation is not repeated. The retention window, also called the TTL (time to live) is 1440 minutes (24 hours) by default but this setting may be changed.
A retry with the same key while the original request is still processing returns 409 Conflict (IdempotencyKeyInProgress). Retry again after a short delay.
Reusing the same key with a different request body returns 422 Unprocessable Content (IdempotencyKeyConflict). Generate a new key for each distinct operation.
A 500 series server error is not stored under the key. A retry with the same key after a 500 series response processes the request again.
Specifies the base amount (in USD) to charge.
For Payment and PaymentAndSave sessions, this value must be greater than zero. For SaveMethod sessions, this value must be zero.
A value of null creates a flexible-amount session. The customer enters the amount.
Examples:
100.00
0
null
Specifies the intent of the session.
| Name | Description |
|---|---|
| Payment | Charges the customer. Does not save a payment method. This is the default. |
| PaymentAndSave | Charges the customer and vaults the payment method used. |
| SaveMethod | Vaults a payment method with no charge. The baseAmount field must be 0. Payment fields such as paymentMethods, tipAmount, taxRate, taxAmount, taxMode, metadata and expiresOn are not accepted. |
For SaveMethod and PaymentAndSave, the saved payment method is reported on paymentSessionResult.paymentMethod once the session is Completed. Its paymentMethodId is the only source of the saved method's id.
Example: Payment
Identifies the payment methods a payment link or payment session accepts. It is keyed by method so each one carries only the configuration that applies to it.
At least one payment method must be enabled, card or ACH. For a payment session, omit this object to offer every payment method available to the merchant. A SaveMethod session does not accept this object. Both may be specified.
Specifies the tax rate percentage to apply to the base amount.
Valid values range from 0 to 100, with up to three decimal places.
A taxMode value must be used with exactly one of taxRate or taxAmount, or none of the three. When all three are omitted, the payment session has no tax configured.
Example: 8.25 (for 8.25%)
Specifies a fixed tax amount (in USD) to apply to the base amount.
This value has up to two decimal places and cannot be negative. This value requires a fixed baseAmount.
A taxMode value must be used with exactly one of taxRate or taxAmount, or none of the three. When all three are omitted, the payment session has no tax configured.
A response carries this value only when the tax was configured as an amount. Otherwise, it is null.
Examples:
3.75 (for $3.75)
null
Specifies how taxRate and taxAmount is applied to amount.
| Name | Description |
|---|---|
| Exclusive | Adds the tax on top of amount. The payer is charged amount plus the tax. |
| Inclusive | Treats amount as already including the tax. No extra amount is added. |
A taxMode value must be used with exactly one of taxRate or taxAmount, or none of the three. When all three are omitted, the payment session has no tax configured.
Example: Exclusive
Specifies the merchant's own label for the payment session.
This value is stored and returned on every read. A value longer than an ACH (automated clearing house) processor accepts is shortened only when it is sent to that processor.
Example: order_123
Specifies a preset tip amount (in USD) added to baseAmount.
This value must be greater than zero. When baseAmount is fixed, this value cannot be greater than baseAmount. This value is not accepted for SaveMethod sessions.
Example: 10.00 (for $10.00)
Specifies an existing customer to attach to the payment session.
The customer's saved payment methods can then be offered. This value cannot be used when customerHandling is TokenOnly.
A list of customer identifiers can be retrieved with GET /v2/customers.
Example: 2d3f4a6b-1c2d-4e5f-8a9b-0c1d2e3f4a5b
Specifies how a vaulted payment method is attached.
This value applies only to SaveMethod and PaymentAndSave sessions.
Valid values are:
| Value | Description |
|---|---|
| CreateCustomer | Attaches the saved payment method to a customer record. This is the default. |
| TokenOnly | Stores the saved payment method as a token with no customer record. This value cannot be used with customerId. |
Example: CreateCustomer
Specifies whether to bypass AVS (address verification service) at the gateway.
This value applies only to Payment and PaymentAndSave sessions.
Valid values are:
| Value | Description |
|---|---|
| false | Does not bypass AVS at the gateway. |
| true | Bypasses AVS at the gateway. |
Example: false
Specifies when the payment session stops accepting payment (in an ISO 8601 date-time format).
This value must be a future date-time with a time zone (a Z suffix or a UTC offset). A zoneless value is rejected rather than guessed. A null or omitted value means the session never expires.
If this value is null or omitted, the session never expires. This value is not accepted for SaveMethod sessions.
Example: 2030-01-01T12:00:00.000Z
Specifies key-value pairs to store with the payment session.
These values are returned on every read. They are not used to process the payment.
The following limits apply:
- At most 50 keys.
- Keys of at most 100 characters.
- Values of at most 500 characters.
- At most 8 KB in total.
This value is not accepted for SaveMethod sessions.
Example: {"orderId": "ORD-9876", "source": "web"}
{ "orderId": "ORD-9876", "source": "web" }
Specifies the HTTPS URL the hosted page sends the customer to after a successful payment.
This value must be an absolute HTTPS URL, at most 2000 characters. A {{paymentSessionId}} placeholder is replaced with the session id.
Example: https://myapp.com/payment/complete
Specifies the customer-facing name shown on the hosted page.
This value is the page subtitle and the browser tab title. If this value is omitted, the page shows only the merchant name.
Example: Order #1234
- Sandbox environmenthttps://sandbox.api.flute.com/v2/payment-sessions/checkout
- Production environmenthttps://api.flute.com/v2/payment-sessions/checkout
Charges $100.00, offering card only, with an 8.25% exclusive tax and a $10.00 tip.
// Language is not supported.Identifies the payment session.
Example: ebece8ac-a375-4bd1-bce7-dd352a00650c
Indicates which surface the session was created for.
Valid values are:
| Value | Description |
|---|---|
| Checkout | Flute hosts the payment page. The session carries a checkoutUrl. |
| Elements | The merchant's own UI, built with the Flute Elements SDK. |
Example: Checkout
Indicates the current status of the payment session.
Valid values are:
| Value | Description |
|---|---|
| Cancelled | The session was canceled with POST /v2/payment-sessions/{{paymentSessionId}}/cancel. |
| Completed | The payment or vault succeeded. |
| Created | The session is ready for use. |
| Expired | expiresOn passed while the session was still Created. A payment submitted just before expiresOn can still move an Expired session to Completed or Failed. |
| Failed | A payment attempt on the session failed. Create a new session to retry. |
Example: Created
Specifies the intent of the session.
| Name | Description |
|---|---|
| Payment | Charges the customer. Does not save a payment method. This is the default. |
| PaymentAndSave | Charges the customer and vaults the payment method used. |
| SaveMethod | Vaults a payment method with no charge. The baseAmount field must be 0. Payment fields such as paymentMethods, tipAmount, taxRate, taxAmount, taxMode, metadata and expiresOn are not accepted. |
For SaveMethod and PaymentAndSave, the saved payment method is reported on paymentSessionResult.paymentMethod once the session is Completed. Its paymentMethodId is the only source of the saved method's id.
Example: Payment
Indicates the amount to charge.
This value is null for a flexible-amount session.
Example: 100.00
Indicates the session's currency, in ISO 4217 uppercase format.
This value is pinned from the merchant's configuration at creation.
Example: USD
Specifies the tax rate percentage to apply to the base amount.
Valid values range from 0 to 100, with up to three decimal places.
A taxMode value must be used with exactly one of taxRate or taxAmount, or none of the three. When all three are omitted, the payment session has no tax configured.
Example: 8.25 (for 8.25%)
Specifies a fixed tax amount (in USD) to apply to the base amount.
This value has up to two decimal places and cannot be negative. This value requires a fixed baseAmount.
A taxMode value must be used with exactly one of taxRate or taxAmount, or none of the three. When all three are omitted, the payment session has no tax configured.
A response carries this value only when the tax was configured as an amount. Otherwise, it is null.
Examples:
3.75 (for $3.75)
null
Specifies how taxRate and taxAmount is applied to amount.
| Name | Description |
|---|---|
| Exclusive | Adds the tax on top of amount. The payer is charged amount plus the tax. |
| Inclusive | Treats amount as already including the tax. No extra amount is added. |
A taxMode value must be used with exactly one of taxRate or taxAmount, or none of the three. When all three are omitted, the payment session has no tax configured.
Example: Exclusive
Indicates the pre-set tip added on top of baseAmount, as set at creation.
Example: 10.00
Indicates the merchant's own label for the session, as set at creation.
Example: order_123
Identifies the customer to link this payment method to.
This value may be null when this payment method is an orphan owned by the merchant directly. An orphan payment method is a payment method in the merchant's vault but has no customer record associated with it.
A list of customer identifiers can be retrieved with GET /v2/customers.
Example: 8fa8e727-73c6-436e-b56f-6f55aabf3b1c
Indicates how a vaulted payment method is attached, as set at creation.
Valid values are:
| Value | Description |
|---|---|
| CreateCustomer | The vaulted payment method is attached to a Customer record. |
| TokenOnly | The vaulted payment method is stored as a bare token, with no Customer record created or referenced. |
Example: CreateCustomer
Indicates whether AVS (address verification service) is bypassed at the gateway for this session.
Valid values are:
| Value | Description |
|---|---|
| false | AVS is not bypassed at the gateway. |
| true | AVS is bypassed at the gateway. |
Example: false
Identifies the payment methods a payment session offers.
It is keyed by method so each one carries only the configuration that applies to it. Card and ACH are the methods configured on the session. Apple Pay® and Google Pay® are digital wallets that the session derives. A wallet key is omitted when the session does not offer that wallet.
Indicates the payment link that generated this session, when applicable.
This value is null for a session created directly through POST /v2/payment-sessions/checkout or POST /v2/payment-sessions/elements.
Example: 6f2a8b3c-9d4e-4f1a-8b7c-3e5d6a9f0c1b
Indicates the hosted page's post-payment redirect URL, as set at creation.
This value is for Flute Checkout sessions only. It is null for Flute Elements.
Example: https://myapp.com/payment/complete
Indicates the customer-facing name shown on the hosted page, as set at creation.
This value is for Flute Checkout sessions only. It is null for Flute Elements.
Example: Order #1234
Indicates the hosted page to send the customer to.
This value is for Flute Checkout sessions only. It is null for Flute Elements.
Example: https://pay.flute.com/checkout/ebece8ac-a375-4bd1-bce7-dd352a00650c
Indicates when the session stops accepting payment, as set at creation.
If null or omitted, the session never expires.
Example: 2030-01-01T12:00:00.000Z
Indicates the free-form string-to-string pairs attached to the session, as set at creation.
Example: { "orderId": "ORD-9876", "source": "web" }
{ "orderId": "ORD-9876", "source": "web" }
Indicates the questions the customer answers on the hosted page, in the order shown.
A session opened from a payment link carries the link's fields as they were when it opened, with the same identifiers. This value is for Flute Checkout sessions only. It is empty for Flute Elements and when there are none.
Indicates when the session was created.
Example: 2026-09-30T00:00:00.000Z
Indicates when the session was last modified.
Example: 2026-09-30T00:00:00.000Z
Indicates what a Completed session produced: the payment method it saved and the transaction it charged.
This value is null until paymentSessionStatus is Completed.
The paymentMethod field is present after a SaveMethod or PaymentAndSave session, with either customerHandling. It is null when the session saved nothing, or when the saved method could not be read at the time. Its paymentMethodId is the only source of the saved method's id: use it with POST /v2/transactions or when creating a subscription.
The linkedTransaction field is null for SaveMethod sessions, which charge nothing.
A Flute Checkout session ready for the customer. Redirect them to checkoutUrl. paymentSessionResult stays null until the session is Completed.
{ "paymentSessionId": "ebece8ac-a375-4bd1-bce7-dd352a00650c", "paymentSessionType": "Checkout", "paymentSessionStatus": "Created", "paymentSessionMode": "Payment", "baseAmount": 100, "currencyCode": "USD", "taxRate": 8.25, "taxAmount": null, "taxMode": "Exclusive", "tipAmount": 10, "referenceId": "order_123", "customerId": "2d3f4a6b-1c2d-4e5f-8a9b-0c1d2e3f4a5b", "customerHandling": "CreateCustomer", "skipAddressVerification": false, "paymentMethods": { "card": { "enabled": true, "processorId": "36e0e61e-3614-4c68-a919-1bffc8bdb7b6" } }, "paymentLinkId": null, "returnUrl": "https://myapp.com/payment/complete", "pageName": "Order #1234", "checkoutUrl": "https://pay.flute.com/checkout/ebece8ac-a375-4bd1-bce7-dd352a00650c", "expiresOn": "2030-01-01T12:00:00.000Z", "metadata": { "orderId": "ORD-9876", "source": "web" }, "extraFields": [ { "extraFieldId": "8b3e4c74-ac73-4f40-9c70-3d4e5f607182", "name": "Order number", "description": null, "isRequired": true } ], "createdOn": "2026-09-30T00:00:00.000Z", "modifiedOn": "2026-09-30T00:00:00.000Z", "paymentSessionResult": null }