Creating Payment Session
Method: POST
Path: /processor/payment-sessions
Requests can be sent with Akinon-User-Access-Token
or without a token.
Query Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
amount | number | required | Total amount of products in the basket. |
currency | currency | optional | Currency of the payment session. If not provided, default is set to TRY. |
order_id | string | required | Unique ID created for the order of the products in the basket. |
conversation_id | string | optional | Conversation number to be sent by the merchant, boomerang value. |
order_date | string | required | Order date. |
cancel_url | string | required | URL redirected when the order is canceled or after an unsuccessful payment transaction. |
success_url | string | required | URL redirected after a successful payment transaction. |
notification_url | string | required | URL to inform the merchant after a successful payment process. |
query_shipping_option_url | string | required | URL where shipping information will be queried. |
query_agreements_url | string | If the agreements_iframe_url field is empty, this field is mandatory | URL where agreements will be queried. |
query_agreement_types_url | string | If the agreements_iframe_url field is empty, this field is mandatory | URL where agreement types will be queried. |
agreements_iframe_url | string | If the query_agreements_url and query_agreement_types_url fields are empty, this field is mandatory | If both query_agreements_url and query_agreement_types_url fields are empty, this field is required for querying agreement types in an iframe. |
preauth | boolean | optional | Determines whether the payment transaction is pre-authorized. Default is false. |
enable_installments | boolean | optional | Used for applying installments if available. Default is true. |
merchant_customer_id | string | optional | Customer identification number belonging to the merchant. If defined, ownership of the payment session is determined. |
merchant_customer_phone_number | string | optional | Customer phone number belonging to the merchant. |
merchant_customer_email | string | optional | Customer email address belonging to the merchant. |
basket | object | optional | Basket holding selected products during the payment session. |
basket.basket_id | string | required | Basket identification number. |
basket.total_product_amount | number | required | Total amount of products in the basket. |
basket.total_discount_amount | number | required | Total discount amount applied to the products in the basket. |
basket.total_amount | number | required | Calculated total amount of products in the basket. |
basket.currency | currency | optional | Currency of the product added to the basket. If not provided, default is set to TRY. |
basket.basket_items[0].sku | string | required | Stock code of the product. |
basket.basket_items[0].basket_item_id | string | required | Unique identification number for each product in the basket. |
basket.basket_items[0].unit_price | number | required | Unit price of each product in the basket. |
basket.basket_items[0].quantity | long | required | Quantity of each product in the basket. |
basket.basket_items[0].price | number | required | Calculated amount of each product in the basket. |
basket.basket_items[0].name | string | required | Name of each product in the basket. |
basket.basket_items[0].image_url | string | optional | URL of the image of each product in the basket. |
basket.discounts[0].description | string | optional | Description of the discount applied to the products in the basket. |
basket.discounts[0].amount | number | required | Percentage of the discount applied to the products in the basket. |
session_owner_id | string | optional | User 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 Name | Type | Description |
---|---|---|
merchant_id | string | Merchant's identity number to which the session is directed during creation. |
customer_id | string | Identification information belonging to the customer. |
amount | number | The total amount of products in the basket. |
currency | currency | The currency of the payment session. |
description | string | Detailed description of the products added to the basket. |
order_id | string | Unique ID created for the order of the products added to the basket. |
cvv_required | boolean | Information about whether the CVV value of the card needs to be used. |
order_date | string | Order date. |
cancel_url | string | URL redirected when the order is canceled or after an unsuccessful payment transaction. |
success_url | string | URL redirected after a successful payment transaction. |
query_shipping_option_url | string | URL where shipping information will be queried. |
query_agreements_url | string | URL where agreements will be queried. |
query_agreement_types_url | string | URL where agreement types will be queried. |
agreements_iframe_url | string | Iframe URL where agreement types will be queried. |
shipping_address | string | Key indicating the address to which the shipment will be sent. |
billing_address | string | Key indicating the address to which the invoice will be sent. |
shipping_option_key | string | Unique identification number for shipments. |
shipping_amount | number | Shipping amount. |
total_amount | number | Total amount of shipping and products in the basket. |
preauth | boolean | Determines whether the payment transaction is pre-authorized. Default is false. |
is_threed | boolean | Determines whether the payment transaction is carried out with 3D. Default is false. |
enable_installments | boolean | Used for applying installments if available. Default is true. |
session_token | string | A unique key created for the session. |
transaction_token | string | A unique key created for the session. |
akinon_user_id | string | Identification number created for the Akinon user. |
created_date | string | Date when the session is created. |
expiry_date | string | Date when the session will expire. |
status | enum | Session status. |
merchant_customer_id | string | Customer identification number belonging to the merchant. |
merchant_customer_phone_number | string | Customer phone number belonging to the merchant. |
merchant_customer_email | string | Customer email address belonging to the merchant. |
basket | object | The basket that holds the selected products and discounts during the payment session. |
basket.basket_id | string | The identification number of the basket. |
basket.total_product_amount | number | Total amount of products in the basket. |
basket.total_discount_amount | number | Total discount amount applied to the products in the basket. |
basket.total_amount | number | Calculated total amount of products in the basket. |
basket.currency | currency | Currency of the product added to the basket. If not provided, TRY is assigned by default. |
basket.basket_items[0].sku | string | Stock code of the product. |
basket.basket_items[0].basket_item_id | string | Unique identification number for each product in the basket. |
basket.basket_items[0].unit_price | number | Unit price of each product in the basket. |
basket.basket_items[0].quantity | long | Quantity of each product in the basket. |
basket.basket_items[0].price | number | Calculated amount of each product in the basket. (quantity*unit_price) |
basket.basket_items[0].name | string | Name of each product in the basket. |
basket.basket_items[0].image_url | string | URL of the image of each product in the basket. |
basket.discounts[0].description | string | Description of the discount applied to the products in the basket. |
basket.discounts[0].amount | number | Percentage of the discount applied to the products in the basket. |
session_owner_email | string | If 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
}
]
}
}
}