Skip to main content

Errors Encountered During Payment Session Creation

In this section, major errors that may occur during payment session creation are outlined. To access all API error codes in general, click here.

1. User Allocation Errors

The following errors can be encountered regarding user allocation.

If both Akinon-User-Access-Token and session_owner_id are defined in the request, and the user ID associated with Akinon-User-Access-Token does not match the session_owner_id, the following error is received.

{
"trace_id": "fc3ffea0-7261-4eb7-XXe1-db4f4079afed",
"response": {
"errors": [
{
"error_code": "INVALID_USER_FOR_PAYMENT_SESSION",
"message": "Kullanıcı adı ödeme oturumu için geçerli değil.",
"argument": null
}
]
}
}

If only the session_owner_id parameter is defined in the request, and no user is found in the system with this ID, the following error is received.

{
"trace_id": "35ec0c18-7f7f-404a-XXd0-7921a97b1d42",
"response": {
"errors": [
{
"error_code": "USER_NOT_FOUND",
"message": "Kullanıcı bulunamadı.",
"argument": null
}
]
}
}

2. Discrepancy Between Basket and Amount

If the total amount of the products sent under the basket parameter in the request does not match the amount parameter, the following error response is returned.

Discounts sent under the discounts parameter have a negative impact.

{
"trace_id": "ef7c0a36-c8ae-XXce-adfb-39a3ea40ac2b",
"response": {
"errors": [
{
"error_code": "AMOUNTS_DONT_MATCH",
"message": "Sepet ve Sipariş tutarları örtüşmüyor.",
"argument": null
}
]
}
}

3. Discrepancy Between Amounts in the Basket

Following errors are received due to discrepancies in the amount parameters sent within the basket.

If a different value is sent in the total_product_amount parameter than the total amount of the products in the basket_items, the following error is returned. discounts in this amount are not taken into account.

{
"trace_id": "5b426641-7853-42XX-9ffe-08be01bfdf55",
"response": {
"errors": [
{
"error_code": "INVALID_TOTAL_PRODUCT_AMOUNT",
"message": "Toplam ürün bedeli (total_product_amount) parametresi hatalı",
"argument": null
}
]
}
}

If a different value is sent in the total_amount parameter than the total amount of products in the basket_items, the following error is returned. discounts in this amount are taken into account.

{
"trace_id": "8a4ca0f9-9d28-4dXX-a585-1d49475967d0",
"response": {
"errors": [
{
"error_code": "INVALID_TOTAL_AMOUNT",
"message": "Sepet toplam tutar (total_amount) parametresi hatalı",
"argument": null
}
]
}
}

If a different value is sent in the total_discount_amount parameter than the total amount of discounts in the discounts parameter, the following error is returned.

{
"trace_id": "b001f490-38b7-4XXc-81a9-b863d63846e5",
"response": {
"errors": [
{
"error_code": "INVALID_TOTAL_DISCOUNT_AMOUNT",
"message": "Toplam indirim tutarı (total_discount_amount) parametresi hatalı",
"argument": null
}
]
}
}

Values for

  • basket.total_discount_amount,
  • basket.basket_items[i].unit_price,
  • basket.basket_items[i].price,
  • basket.discounts[i].amount

can be equal to 0 (zero).

In this case, no error is received. But if these values are equal to 0 (zero) and there is only one product in the basket, the amount value becomes 0 (zero), and only in this case, the following error is received.

{
"trace_id": "4f58e075-345e-48XX-8855-9453ceef7ee0",
"response": {
"errors": [
{
"error_code": "INVALID_AMOUNT_VALUE",
"message": "Invalid amount. Please provide a valid, positive value.",
"argument": "basket.totalProductAmount"
},
{
"error_code": "INVALID_AMOUNT_VALUE",
"message": "Invalid amount. Please provide a valid, positive value.",
"argument": "basket.totalAmount"
},
{
"error_code": "INVALID_AMOUNT_VALUE",
"message": "Invalid amount. Please provide a valid, positive value.",
"argument": "amount"
}
]
}
}

4. Use of the Same Order Number

If a previously used order number in another payment session is used in the request, the following error response is returned.

{
"trace_id": "8bc1d536-a1f6-4e81-835b-73XX5b28d081",
"response": {
"errors": [
{
"error_code": "ORDER_ID_EXISTS",
"message": "Bu Order Id ile daha önceden bir oturum oluşturulmuş.",
"argument": null
}
]
}
}