Skip to main content

session/init/payment

session/init/payment​

Send this request to simultaneously create a payment session and start a payment.

The response contains the parameters of a session created and information on the payment (acquiring_payments/payment_list).

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

Endpoint​

api/v1/session/init/payment

Request parameters​

NameMandatoryTypeDescription
payment_details+objectPayment data
amount_details+objectAmount in the USD decimal format. To send 100 USD, specify 10000
items-objectPurchased product/service details
participant_details-objectInformation on the sender and recipient
customer+objectRecipient's data in your system
payment_options-objectAdditional payment parameters
metadata- (mandatory for submerchants)*Any additional information. If the transaction is processed by a submerchant, specify the payment site: "metadata" {"merchant": "","submerchant": "https ://website"}
Request example
curl -X POST \
https://demo.smart-glocal.com/api/v1/session/init/payment \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "4242424242424242",
"expiration_month": "05",
"expiration_year": "35",
"security_code": "123"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "usd"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"return_url": "https://website.com"
},
"metadata": {
"submerchant": "https://submerchant-site-url.com",
"merchant_order_id": "123123",
"user_os": "android",
"user_location": "DE"
}
}'

Response parameters​

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
session-objectPayment session
error-objectError description
Successful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z",
"acquiring_payments": [{
"id": "pm_203",
"status": "in_progress",
"created_at": "2024-05-27T02:03:00.000000Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "card",
"card": {
"brand": "visa",
"last4": "4242"
}
},
"amount_details": {
"amount": 10000,
"currency": "usd"
},
"payment_options": {
"return_url": "https://website.com"
},
"metadata": "good"
}]
}
}
Unsuccessful response example
{
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}