Checkout

Create checkout session

Changed on
post/checkout/sessions

Request

  • Base URL
    https://us.api.flexprice.io/v1
  • URL
    https://us.api.flexprice.io/v1/checkout/sessions
  • Auth
    API key in header x-api-key

Request body

action'create_subscription' | 'modify_subscription' | 'wallet_topup' | 'add_addon' | 'pay_invoice' required
cancel_urlstring
customer_external_idstring required
failure_urlstring
idempotency_keystring
metadataobject
payment_provider'razorpay' | 'chargebee' | 'stripe' required
success_urlstring

Response

Created

action'create_subscription' | 'modify_subscription' | 'wallet_topup' | 'add_addon' | 'pay_invoice'
cancel_urlstring
cancelled_atstring date-time
checkout_invoice_idstring
checkout_payment_idstring
checkout_status'initiated' | 'pending' | 'completed' | 'failed' | 'expired'
completed_atstring date-time
created_atstring date-time
customer_idstring
expires_atstring date-time
failure_reasonstring
failure_urlstring
idstring
idempotency_keystring
metadataTypesMetadata
next_poll_after_msinteger

NextPollAfterMs is how long a client should wait before reading again. Zero means stop — either the session is terminal, or this response did not come from a polling read.

payment_provider'razorpay' | 'chargebee' | 'stripe'
staleboolean

Stale reports that this response is stored state that was not checked against the payment provider on this request — the read was debounced, or the gateway did not answer. A UI should say "still checking" rather than presenting a stale answer as fact.

success_urlstring
terminalboolean

Terminal reports whether the session has finished. Clients poll until this is true rather than hardcoding the status set, which would go stale if a status is ever added.

updated_atstring date-time

Changes

    • info

      added the new optional request property //

    • info

      added the new trial_end enum value to the request property //

    • info

      added the new optional request property /