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.

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.

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.

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.

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.

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.

Last updated

Was this helpful?