Skip to main content
GET
/
payment-sessions
/
{paymentSessionId}
Get payment session
curl --request GET \
  --url https://apiv2.example.com/payment-sessions/{paymentSessionId} \
  --header 'X-Api-Key: <api-key>'
{
  "paymentSessionId": "d2e3f4a5-b6c7-8901-2345-012345678901",
  "orderId": "e3f4a5b6-c7d8-9012-3456-123456789012",
  "paymentProvider": "STRIPE",
  "savePaymentProfile": true,
  "hosted": false,
  "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",
  "paymentProfileId": "f4a5b6c7-d8e9-0123-4567-234567890123",
  "returnUrl": "https://example.com/order/confirmation",
  "cancelUrl": "https://example.com/order/checkout"
}

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.

Path Parameters

paymentSessionId
string
required

The unique identifier of the payment session to retrieve.

Response

Payment session retrieved 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

hosted
boolean
required

Whether this payment session uses a hosted checkout page. When true, the provider configuration contains a checkout URL for redirecting the customer. When false, it contains a client secret for rendering an embedded payment widget.

Example:

false

provider
Stripe Payment Intent Configuration · object
required

Details specific to the payment provider used for this payment session. The shape depends on the provider and whether hosted mode is used.

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"

returnUrl
string

The URL the customer is redirected to after payment completion. Present when hosted is true.

Example:

"https://example.com/order/confirmation"

cancelUrl
string

The URL the customer is redirected to if they cancel the payment. Present when hosted is true.

Example:

"https://example.com/order/checkout"