Skip to main content

session/create

session/create

This request creates 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.

The response contains the parameters of the session created.

Endpoint

api/v1/session/create

Request parameters

NameMandatoryTypeDescription
payment_method-PaymentMethodPayout details (card, customer account, etc.)
payment_details-PaymentDetailsPayment data
amount_details-AmountDetailsAmount. Transmitted in the USD decimal format. If you are sending 100 USD, you will need to specify 10000
participant_details-ParticipantDetailsInformation on the sender and recipient
customerMandatory for paymentsCustomerRecipient's data in your system
payment_options-PaymentOptionsAdditional 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 (for payouts)/payment_details (for payments), customer (for payments), and amount_details (for payouts and 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: 721af394d5a7aefd0e91f5390abc4d7e20fb2b5784b091fef621f3c61b7abb4b' \
-d '{
"amount_details": {
"amount": 10000,
"currency": "usd"
},
"metadata": "order123"
}'

Response parameters

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
session-PaymentSessionPayment session
error-ErrorError

Successful response example

    {
"status": "ok",
"session": {
"id": "3230",
"status": "created",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
}
}

Unsuccessful response example

    {
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}