For the complete documentation index, see llms.txt. This page is also available as Markdown.

Process checkout provider payment notification and create the order

Receives the payment notification from the checkout provider and creates the order. This endpoint is called as a callback by the provider after the customer completes the payment on the hosted form. It validates the conversation ID, resolves or creates the customer account, saves addresses, sets the shipping option, configures installment data, and finalizes the pre-order into a completed order.

Required Fields: agreements, conversation_id, payment_info, transaction, card_info, akifast_user, is_successful

Optional Fields: shipping_address, billing_address

Validation:

  • agreements must be true (agreement acceptance required)

  • conversation_id must match the one stored in pre_order.checkout_provider_data

  • is_successful must be true (transaction must have succeeded)

  • transaction.installment_count must be between 1 and 12

  • transaction.conversation_id must match pre_order.checkout_provider_data['conversation_id']

State Updates:

  • User account is resolved or created via social account login

  • Shipping and billing addresses are set and saved

  • pre_order.shipping_option set from transaction.shipping_option_key

  • pre_order.shipping_amount calculated for the selected option

  • pre_order.payment_option set to the first active credit card option

  • pre_order.pos_alt set from payment_info.payment_system_code

  • pre_order.card_info populated with the card BIN number

  • pre_order.checkout_provider_data['installment_alt'] set with installment_count and interest_amount

  • pre_order.checkout_provider_data['checkout_provider_purchase_raw_response'] set

  • pre_order.checkout_provider_data['use_three_d_secure'] set from transaction.is_threed

  • Order is finalized (pre-order converted to completed order)

Error Handling:

  • If is_successful or agreements is false, a validation error is returned and the order number is reset.

Next Page: CheckoutProviderThankYouPage

post
Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body

Payment notification payload sent by the checkout provider after the customer completes payment on the hosted form. Used to create the order, set shipping, link the customer account, and finalize the pre-order.

agreementsboolean · enumRequired

Customer's acceptance of the agreement. Must be true; any other value returns a validation error.

Example: truePossible values:
is_successfulboolean · enumRequired

Payment success flag from the provider. Must be true; any other value returns a validation error.

Example: truePossible values:
conversation_idstringRequired

Provider conversation identifier. Must match pre_order.checkout_provider_data['conversation_id'].

Example: conv-abc-123
Responses
200

Order created

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=CheckoutProviderNotificationPage
POST /orders/checkout/?page=CheckoutProviderNotificationPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 435

"agreements=true&conversation_id='conv-abc-123'&is_successful=true&payment_info={'payment_system_code':'garanti'}&transaction={'installment_count':1,'interest_rate':0,'interest_amount':0,'total_paid_amount':250,'payment_system_raw_response':'{}','shipping_option_key':1,'is_threed':false}&card_info=[{'bin':'454321'}]&akifast_user={'akinon_user_id':'user-id-123','name':'John','surname':'Doe','email':'user@example.com'}"
200

Order created

{
  "context_list": [
    {
      "page_name": "CheckoutProviderThankYouPage",
      "page_slug": "checkoutproviderthankyoupage",
      "page_context": {
        "return_url": "https://shop.example.com/orders/success/abc123/",
        "merchant_customer_id": 42,
        "merchant_customer_date_joined": "2024-01-15T08:30:00+00:00",
        "merchant_customer_akifast_date_joined": "2024-06-01T10:00:00+00:00"
      }
    }
  ],
  "pre_order": {
    "user_email": "user@akinon.com"
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?