Skip to main content

session/create

session/create

Send this request to create a payment session on Smart Glocal's side.

Payment operations can only be performed within a session. One or more operations of the same or different types can be performed within a session (e.g. several payouts, a payment and a refund, or a payment which is subsequently split).

Use this request if you need to request data necessary to perform a payout or a payment from the user. For example, call the tokenization widget, show it to the user and get tokenized card details, and then send the payout request with those details.

If you are ready to pass the payout/payment parameters right away, you can do so:
For payments, pass payment_details, amount_details, and customer.
For payouts, pass payment_method and amount_details.

The response contains the parameters of a session created.

Endpoint

api/v1/session/create

Request parameters

NameMandatoryTypeDescription
payment_method-objectPayout details
payment_details-objectPayment details
amount_details-objectAmount in the USD decimal format. To send 100 USD, specify 10000
participant_details-objectInformation on the sender and recipient
customer-objectRecipient's data in your system
payment_options-objectAdditional payment parameters
metadata-*Additional information. Any data you need in order to perform the operation. Returned in responses and webhooks

If you do not specify payment_method and amount_details for payouts/payment_details, customer, and amount_details for payments in this request, make sure you specify them in your session/start/payment or session/start/payout request, respectively.

Request example
curl -X POST \
https://demo.smart-glocal.com/api/v1/session/create \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"amount_details": {
"amount": 10000,
"currency": "usd"
},
"metadata": "order123"
}'

Response parameters

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
session-objectPayment session
error-objectError description
Successful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "created",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z",
}
}
Unsuccessful response example
{
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}