Skip to main content

getSessionByOrderId

Get one payment session object by order identifier. 🔐 This method requires authorization.

Description

This method retrieves payment session(s) associated with a specific order by its identifier. It returns a Promise that resolves to an ISessionEntity object or an array of ISessionEntity objects.

Payments.getSessionByOrderId(

id*

);

Parameters schema

Schema

id(required): number
Order identifier
example: 12345

Examples

Try it live

Run this method interactively in the JS SDK sandbox — connect your Project URL and App Token on first visit, then open:

  • Order pay — fetch the payment session for an order placed by a registered user.
  • Tickets order — get the payment session created for a tickets order.
  • Guest order — retrieve the payment session for a guest order.

Minimal example

const response = await Payments.getSessionByOrderId(1764);

Example response

[
{
"id": 1,
"createdDate": "2025-02-25T10:52:59.634Z",
"updatedDate": "2025-02-25T10:52:59.634Z",
"type": "session",
"status": "waiting",
"paymentAccountId": 1,
"orderId": 2,
"amount": null,
"paymentUrl": null
}
]

Response schema

Schema: IAccountsEntity

id: number
Object identifier.
example: 12345

localizeInfos: ILocalizeInfo
Json description of the payment account object.

identifier: string
Text identifier for the recording field.
example: "payment_12345"

type: 'stripe' | 'custom'
Type may be 'stripe' or 'custom'.
example: 'stripe'

isVisible: boolean
Visibility indicator of the payment account.
example: true

isUsed: boolean
Usage indicator of the payment account.
example: false

testMode: boolean
Indicates whether the payment account is in test mode.
example: true

settings: IPaymentAccountSettings
Payment account settings.
example: { "status": "connected" }

settings.status: string
Connection status of the live (non-test) payment account.
example: "connected"

testSettings: object
Test mode settings for the payment account.

updatedDate: string
Object modification date.
example: "2025-02-26T10:13:16.839Z"