Skip to main content
POST
/
payment-sessions
{
  "paymentSessionId": "d2e3f4a5-b6c7-8901-2345-012345678901",
  "orderId": "e3f4a5b6-c7d8-9012-3456-123456789012",
  "paymentProvider": "STRIPE",
  "paymentProfileId": "f4a5b6c7-d8e9-0123-4567-234567890123",
  "savePaymentProfile": true,
  "provider": {
    "clientSecret": "pi_1234_secret_abcd",
    "publishableKey": "pk_test_1234567890abcdef",
    "paymentIntentId": "pi_1234567890abcdef"
  },
  "status": "PENDING",
  "metadata": {
    "source": "mobile_app",
    "campaign": "summer_2024"
  },
  "createdAt": "2024-09-29T10:00:00Z",
  "updatedAt": "2024-09-29T10:30:00Z"
}

Authorizations

X-API-Key
string
header
required

An API key that grants access to the Connect API. You can create and manage API keys in the portal.

Headers

X-Idempotency-Key
string

A unique key to ensure idempotency of requests. If a request with the same key has already been processed, the same result will be returned. The key must be unique for each distinct operation. Keys are expired after 24 hours, but we recommend using a new key for each request.

Modified requests with the same idempotency keys are rejected with a 409 Conflict status code.

Maximum length: 256

Body

application/json

Request to create a new payment session for processing payment for an order.

orderId
string
required

The unique identifier of the order to create a payment session for.

Example:

"d4e5f6a7-b8c9-0123-4567-89abcdef0123"

paymentProvider
string
required

Payment service provider for processing transactions.

Example:

"STRIPE"

paymentProfileId
string

You can add the previously saved payment method to prefill in the payment details.

Example:

"e5f6a7b8-c9d0-1234-5678-9abcdef01234"

savePaymentProfile
boolean

Whether to save the payment profile for future use. Only applicable if the customer is authenticated or for the initial order. Defaults to false.

Example:

true

setAsDefaultPaymentProfile
boolean

Whether to set the payment method as the default for future payments. Only applicable if savePaymentProfile is true and the customer is authenticated or for the initial order. Defaults to false.

metadata
object

A set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format.

Response

Payment session created successfully

A payment session that wraps the payment process and collects payment information from the user for a specific order.

paymentSessionId
string
required

The unique identifier for this payment session.

Example:

"d2e3f4a5-b6c7-8901-2345-012345678901"

orderId
string
required

The unique identifier of the order this payment session is for.

Example:

"e3f4a5b6-c7d8-9012-3456-123456789012"

paymentProvider
string
required

Payment service provider for processing transactions.

Example:

"STRIPE"

savePaymentProfile
boolean
required

Whether to save the payment profile for future use. Only applicable if the customer is authenticated or for the initial order. Defaults to false.

Example:

true

provider
object
required

Details specific to the payment provider used for this payment session. Stripe-specific configuration for payment session widget rendering.

status
enum<string>
required

Current status of a payment session lifecycle.

Available options:
PENDING,
REQUIRES_ACTION,
COMPLETED,
FAILED
Example:

"PENDING"

metadata
object
required

Custom key-value pairs for additional payment session information.

Example:
{
"source": "mobile_app",
"campaign": "summer_2024"
}
createdAt
string<date-time>
required

When this payment session was created.

Example:

"2024-09-29T10:00:00Z"

updatedAt
string<date-time>
required

When this payment session was last updated.

Example:

"2024-09-29T10:30:00Z"

paymentProfileId
string

The saved payment method to use for this payment (for returning customers).

Example:

"f4a5b6c7-d8e9-0123-4567-234567890123"

I