Skip to main content

Get Payment Session

Retrieve the current state of a Payment Session. This is useful for resuming an interrupted flow or checking the status of a session created by the merchant's backend.

GET /session/:sessionId

Request Parameters

FieldTypeRequiredDescription
sessionIdStringThe unique identifier of the payment session. Passed as a path parameter.

Response Structure

The response contains the session details and the aiView.

If the session was created via the Create Session endpoint, the aiView will be in the session_ready stage with preparePaymentRequirement.

If the session was created by the merchant backend without specifying a payer or token, the aiView might contain a completePaymentSessionGuide instead, instructing the client to select payment parameters before proceeding.

Response Example (Ready for Payment)

{
"sessionId": "sess_example_payment_04",
"sessionType": "ai_checkout",
"lineItems": [
// ... items ...
],
"aiView": {
"pricingModel": { "type": "fixed" },
"workflow": {
"stage": "session_ready",
"nextAction": {
"action": "prepare_payment",
"authorizationRequired": true
}
},
"preparePaymentRequirement": {
"authorizationRequired": true,
"authorizationSpec": {
"type": "eip712",
"purpose": "prepare_payment",
"domain": {
"name": "aipay.gstable.io",
"version": "1",
"chainId": "137"
},
"types": {
"PreparePaymentAuthorization": [
{ "name": "purpose", "type": "string" },
{ "name": "sessionId", "type": "string" },
{ "name": "merchantId", "type": "string" },
{ "name": "paymentChainId", "type": "uint256" },
{ "name": "paymentToken", "type": "address" },
{ "name": "payer", "type": "address" },
{ "name": "payerEmail", "type": "string" },
{ "name": "authorizationNonce", "type": "bytes32" },
{ "name": "authorizationExpiresAt", "type": "uint256" }
]
},
"messageTemplate": {
// ... template values ...
}
}
}
}
}

Error Handling

This endpoint follows the Unified Error Handling standard. Business errors return HTTP 200 with a non-zero code.