Skip to main content

getSessions

Get a list of payment sessions. 🔐 This method requires authorization.

Description​

Fetches payment sessions, one page at a time (offset, limit). Resolves to an ISessionsEntity.

.getSessions(

,

);

Parameters schema​

Schema

offset: number
Number of records to skip. Default: 0. offset + limit must not exceed 200; a larger window is rejected with 400.
example: 0

limit: number
Maximum number of records to return. Default: 30.
example: 30

Record limit. If the user group's permission for this method allows only restricted reading, the API returns at most the number of records set in the project settings (10 by default), whatever limit you pass. With full read access, limit works as usual. See Module permissions (opens in a new tab).

Examples​

Minimal example​

const response = await Payments.getSessions();

Example with pagination​

const response = await Payments.getSessions(0, 30);

Example response​

{
"items": [
{
"id": 60,
"createdDate": "2026-10-26T16:27:15.214Z",
"updatedDate": "2026-10-26T16:27:15.214Z",
"type": "session",
"status": "waiting",
"paymentAccountId": 1,
"orderId": 685,
"amount": null,
"paymentUrl": null
},
{
"id": 59,
"createdDate": "2026-10-26T13:25:17.923Z",
"updatedDate": "2026-10-26T13:25:17.923Z",
"type": "session",
"status": "waiting",
"paymentAccountId": 1,
"orderId": 794,
"amount": null,
"paymentUrl": null
},
{
"id": 58,
"createdDate": "2026-10-08T10:11:50.084Z",
"updatedDate": "2026-10-26T16:27:15.208Z",
"type": "session",
"status": "canceled",
"paymentAccountId": 1,
"orderId": 685,
"amount": null,
"paymentUrl": null
}
],
"total": 55
}

Response schema​

Schema: ISessionsEntity

total: number
Total number of found records.
example: 100

items: ISessionEntity[]
Payment sessions in this response.
example:

[
{
"id": 27,
"createdDate": "2025-06-04T04:38:32.849Z",
"updatedDate": "2025-06-04T04:38:32.849Z",
"type": "session",
"status": "waiting",
"paymentAccountId": 1,
"orderId": 55,
"paymentUrl": null
}
]

items.id: number
Object ID.
example: 1764

items.createdDate: string
Creation date.
example: "2025-02-26T10:13:16.839Z"

items.updatedDate: string
Date the object was last modified.
example: "2025-02-26T10:13:16.839Z"

items.type: 'session' | 'intent'
Session type: "session" or "intent".
example: "session"

items.status: string
Payment status.
example: "completed"

items.paymentAccountId: number
ID of the payment account.
example: 1

items.orderId: number
ID of the order.
example: 1

items.paymentUrl: string | null
Payment page URL.
example: "https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M"

items.amount: number | null
Payment session amount.
example: 100

items.clientSecret: string
Client secret returned by the payment provider (for example, Stripe) when the session is created.
example: "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH"