Skip to main content

getAccountById

Get one payment account object by its identifier. 🔐 This method requires authorization.

Description

This method get a single payment account object by its identifier. It returns a Promise that resolves to a payment account object IAccountsEntity.

Payments.getAccountById(

id*

);

Parameters schema

Schema

id(required): number
Identifier of the retrieved payment account object
example: 12345

Examples

Minimal example

const response = await Payments.getAccountById(1764);

Example with settings for stripe

const settings = {
"stripeAccountId": "acct_1RsDXzHy1QOsjfBI",
"stripeOnboardingComplete": true,
"stripePublishableKey": "pk_test_51OO...Y7MS3",
"successUrl": "https://example.com/success",
"cancelUrl": "https://example.com/cancel",
"sessionTimeout": 15
};
const response = await Payments.getAccountById(1764, settings);

Example with settings for yookassa

const settings = {
"shopId": "1234567",
"secretKey": "test_pazk0r3JNlMEEwQq6t3Syk-qapXL0ArHvdXYxtaDvcv",
"successUrl": "https://example.com/success",
"cancelUrl": "https://example.com/cancel",
"sessionTimeout": 15
};
const response = await Payments.getAccountById(1764, settings);

Example response

{
"id": 1,
"identifier": "cash",
"isVisible": true,
"localizeInfos": {
"title": "Cash"
},
"type": "custom",
"isUsed": true,
"testMode": true,
"settings": {
"status": "connected"
},
"testSettings": {
"status": "connected"
},
"updatedDate": "2025-02-25T08:55:43.957Z"
}

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