Skip to main content

Creating Payment Session

Method: POST

Path: /processor/payment-sessions

Requests can be sent with Akinon-User-Access-Token or without a token.

Query Parameters

ParameterTypeMandatoryDescription
amountnumberrequiredTotal amount of products in the basket.
currencycurrencyoptionalCurrency of the payment session. If not provided, default is set to TRY.
order_idstringrequiredUnique ID created for the order of the products in the basket.
conversation_idstringoptionalConversation number to be sent by the merchant, boomerang value.
order_datestringrequiredOrder date.
cancel_urlstringrequiredURL redirected when the order is canceled or after an unsuccessful payment transaction.
success_urlstringrequiredURL redirected after a successful payment transaction.
notification_urlstringrequiredURL to inform the merchant after a successful payment process.
query_shipping_option_urlstringrequiredURL where shipping information will be queried.
query_agreements_urlstringIf the agreements_iframe_url field is empty, this field is mandatoryURL where agreements will be queried.
query_agreement_types_urlstringIf the agreements_iframe_url field is empty, this field is mandatoryURL where agreement types will be queried.
agreements_iframe_urlstringIf the query_agreements_url and query_agreement_types_url fields are empty, this field is mandatoryIf both query_agreements_url and query_agreement_types_url fields are empty, this field is required for querying agreement types in an iframe.
preauthbooleanoptionalDetermines whether the payment transaction is pre-authorized. Default is false.
enable_installmentsbooleanoptionalUsed for applying installments if available. Default is true.
merchant_customer_idstringoptionalCustomer identification number belonging to the merchant. If defined, ownership of the payment session is determined.
merchant_customer_phone_numberstringoptionalCustomer phone number belonging to the merchant.
merchant_customer_emailstringoptionalCustomer email address belonging to the merchant.
basketobjectoptionalBasket holding selected products during the payment session.
basket.basket_idstringrequiredBasket identification number.
basket.total_product_amountnumberrequiredTotal amount of products in the basket.
basket.total_discount_amountnumberrequiredTotal discount amount applied to the products in the basket.
basket.total_amountnumberrequiredCalculated total amount of products in the basket.
basket.currencycurrencyoptionalCurrency of the product added to the basket. If not provided, default is set to TRY.
basket.basket_items[0].skustringrequiredStock code of the product.
basket.basket_items[0].basket_item_idstringrequiredUnique identification number for each product in the basket.
basket.basket_items[0].unit_pricenumberrequiredUnit price of each product in the basket.
basket.basket_items[0].quantitylongrequiredQuantity of each product in the basket.
basket.basket_items[0].pricenumberrequiredCalculated amount of each product in the basket.
basket.basket_items[0].namestringrequiredName of each product in the basket.
basket.basket_items[0].image_urlstringoptionalURL of the image of each product in the basket.
basket.discounts[0].descriptionstringoptionalDescription of the discount applied to the products in the basket.
basket.discounts[0].amountnumberrequiredPercentage of the discount applied to the products in the basket.
session_owner_idstringoptionalUser ID present in the Akinon system. If defined, the payment session is allocated only for this user.

Example Request

{
"amount" : "80",
"currency" : "TRY",
"order_id" : "28022XX21430",
"conversation_id": "JHsxbsW28022XX21430",
"order_date" : "2021-12-16T15:01:23.51+03:00",
"cancel_url" : "http://localhost:7005/cancel-order/2022022XX43627",
"success_url" : "http://localhost:7005/success-order/2022022XX43627",
"notification_url" : "http://localhost:7005/notify-url/2022022XX43627",
"preauth" : false,
"query_shipping_option_url": "https://61c1c3459dbccaXX17c82102.mockapi.io/api/shipping_options",
"query_agreements_url": "https://61dd7bc1fXXe8f0017668849.mockapi.io/agreements",
"query_agreement_types_url": "http://localhost:7005/query-agreement-types",
"agreements_iframe_url": "http://localhost:7005/agreements-iframe-url",
"enable_installments" : true,
"merchant_customer_id": null,
"merchant_customer_phone_number": null,
"merchant_customer_email": null,
"session_owner_id": "C2C0CE12F64B410XX09BB854D08706F5",
"basket" : {
"basket_id" : "B-20211XX91524",
"total_product_amount": "100",
"total_discount_amount" : "20",
"total_amount" : "80",
"currency" : "TRY",
"total_quantity" : 1,
"basket_items" : [
{
"sku": "2100123574",
"basket_item_id" : "P-B-20211XX91524-1",
"unit_price": "100",
"quantity" : 1,
"price": "100",
"brand" : "test brand",
"name" : "test name",
"image_url" : "test image url"
}
],
"discounts" : [
{
"description" : "test description",
"amount" : "20"
}
]
}
}

Response Parameters

Field NameTypeDescription
merchant_idstringMerchant's identity number to which the session is directed during creation.
customer_idstringIdentification information belonging to the customer.
amountnumberThe total amount of products in the basket.
currencycurrencyThe currency of the payment session.
descriptionstringDetailed description of the products added to the basket.
order_idstringUnique ID created for the order of the products added to the basket.
cvv_requiredbooleanInformation about whether the CVV value of the card needs to be used.
order_datestringOrder date.
cancel_urlstringURL redirected when the order is canceled or after an unsuccessful payment transaction.
success_urlstringURL redirected after a successful payment transaction.
query_shipping_option_urlstringURL where shipping information will be queried.
query_agreements_urlstringURL where agreements will be queried.
query_agreement_types_urlstringURL where agreement types will be queried.
agreements_iframe_urlstringIframe URL where agreement types will be queried.
shipping_addressstringKey indicating the address to which the shipment will be sent.
billing_addressstringKey indicating the address to which the invoice will be sent.
shipping_option_keystringUnique identification number for shipments.
shipping_amountnumberShipping amount.
total_amountnumberTotal amount of shipping and products in the basket.
preauthbooleanDetermines whether the payment transaction is pre-authorized. Default is false.
is_threedbooleanDetermines whether the payment transaction is carried out with 3D. Default is false.
enable_installmentsbooleanUsed for applying installments if available. Default is true.
session_tokenstringA unique key created for the session.
transaction_tokenstringA unique key created for the session.
akinon_user_idstringIdentification number created for the Akinon user.
created_datestringDate when the session is created.
expiry_datestringDate when the session will expire.
statusenumSession status.
merchant_customer_idstringCustomer identification number belonging to the merchant.
merchant_customer_phone_numberstringCustomer phone number belonging to the merchant.
merchant_customer_emailstringCustomer email address belonging to the merchant.
basketobjectThe basket that holds the selected products and discounts during the payment session.
basket.basket_idstringThe identification number of the basket.
basket.total_product_amountnumberTotal amount of products in the basket.
basket.total_discount_amountnumberTotal discount amount applied to the products in the basket.
basket.total_amountnumberCalculated total amount of products in the basket.
basket.currencycurrencyCurrency of the product added to the basket. If not provided, TRY is assigned by default.
basket.basket_items[0].skustringStock code of the product.
basket.basket_items[0].basket_item_idstringUnique identification number for each product in the basket.
basket.basket_items[0].unit_pricenumberUnit price of each product in the basket.
basket.basket_items[0].quantitylongQuantity of each product in the basket.
basket.basket_items[0].pricenumberCalculated amount of each product in the basket. (quantity*unit_price)
basket.basket_items[0].namestringName of each product in the basket.
basket.basket_items[0].image_urlstringURL of the image of each product in the basket.
basket.discounts[0].descriptionstringDescription of the discount applied to the products in the basket.
basket.discounts[0].amountnumberPercentage of the discount applied to the products in the basket.
session_owner_emailstringIf filled, indicates that the related payment session belongs only to this user.

Example Response

{
"trace_id": "a4dde67e-2ee5-417e-98XX-45c7aa0e088f",
"response": {
"merchant_id": "9d36ec04-de2f-11ea-87XX-0242ac130003",
"customer_id": "CUSTOMER_060X16",
"amount": 80,
"currency": "TRY",
"description": "test description",
"order_id": "28022XX21430",
"cvv_required": true,
"order_date": "2021-12-16T15:01:23.51+03:00",
"cancel_url": "http://localhost:7005/cancel-order/2022022XX43627",
"success_url": "http://localhost:7005/success-order/2022022XX43627",
"query_shipping_option_url": "https://61c1c3459dXXca0017c82102.mockapi.io/api/shipping_options",
"query_agreements_url": "https://61dd7bc1fXXe8f0017668849.mockapi.io/agreements",
"query_agreement_types_url": "http://localhost:7005/query-agreement-types",
"agreements_iframe_url": "http://localhost:7005/agreements-iframe-url",
"shipping_address": null,
"billing_address": null,
"shipping_option_key": null,
"shipping_amount": null,
"total_amount": 100,
"preauth": false,
"is_threed": false,
"enable_installments": true,
"session_token": "e7d624f0-c842-4826-a3XX-8c05cc6d6114",
"transaction_token": "JGmhG9bOro82/84JdjAWNflDH2dynHsckkrpRRXXpc73NLwSSe5+dzHa9JxdpIBKnWtAEfGhaYpFGrEoBQJlyg==",
"akinon_user_id": "C2C0CE12F64B41038XXBB854D08706F5",
"created_date": "2022-03-01T11:08:29.67+03:00",
"expiry_date": "2022-03-01T12:08:29.66+03:00",
"status": "ACTIVE",
"merchant_customer_id": null,
"merchant_customer_phone_number": null,
"merchant_customer_email": null,
"session_owner_email": "john.doe@example.com",
"basket": {
"basket_id": "B-20211X191524",
"total_product_amount": 100,
"total_discount_amount": 20,
"total_amount": 80,
"currency": "TRY",
"basket_items": [
{
"sku": "2100XX3574",
"basket_item_id": "P-B-20211XX91524-1",
"unit_price": 100,
"quantity": 1,
"price": 100,
"name": "test name",
"image_url": "test image url"
}
],
"discounts": [
{
"description": "test description",
"amount": 20
}
]
}
}
}