Skip to main content

session/init/payout

session/init/payout

This request is used to simultaneously create a session and start a payout if you are ready to pass all the parameters needed for the payout.

The response contains the parameters of the session created and information on the payout (Payment).

If you decide to use this method, please use an idempotency key.

Endpoint

api/v1/session/init/payout

Request parameters

NameMandatoryTypeDescription
payment_method+PaymentMethodPayout 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
customer-CustomerRecipient's data in your system
metadata-*Additional information. Any data you need in order to perform the operation. Returned in responses and webhooks

Request example

curl -X POST \
https://demo.smart-glocal.com/api/v1/session/init/payout \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: 721af394d5a7aefd0e91f5390abc4d7e20fb2b5784b091fef621f3c61b7abb4b' \
-d '{
"payment_method": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "4242424242424242"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "usd"
},
"participant_details": {
"recipient": {
"full_name": "John Johnson"
}
}
}'

Response parameters

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

Successful response example

{
"status": "ok",
"session": {
"id": "3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payments": [
{
"id": "2018",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [
{
"email": "user@gmail.com"
}
]
},
"payment_method": {
"type": "card",
"card": {
"last4": "4242",
"brand": "visa"
}
},
"amount_details": {
"amount": 10000,
"currency": "usd"
},
"metadata": "good"
}
]
}
}

Unsuccessful response example

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