> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/checkout/entry-and-address/process-checkout-provider-payment-notification-and-create-the-order.md).

# 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`

```json
{"openapi":"3.1.0","info":{"title":"Overview","version":"1.0.0"},"tags":[{"name":"Entry & Address","description":"# Checkout Entry & Address\n\nStart a checkout session and collect delivery information from your customers. These endpoints handle session initialization, delivery address selection, order notes, B2B account settings, and the entry point for external checkout providers.\n\n## Authentication\n\nThese endpoints support both authenticated and anonymous sessions.\n\n- **Authenticated users**: Session cookie (`sessionid`) tracks checkout progress.\n- **Anonymous users**: Guest checkout is available when the `CAN_GUEST_PURCHASE` setting is enabled.\n## Request Format\n\nInclude the following header in all checkout requests:\n\n- **x-requested-with**: `XMLHttpRequest`\n\n## Dynamic Settings\n\n### CAN_GUEST_PURCHASE\nControls whether unauthenticated users can proceed through checkout. When disabled, unauthenticated users are redirected to the login page.\n\n### GIFT_BOX_CONFIGURATIONS\nControls whether the gift box option is shown during checkout entry. Set `is_active` to `true` and provide a product `sku` to enable.\n\n### DEFAULT_COUNTRY_CODE\nDefault country used to pre-populate the country field in the address selection form.\n\n### REMOTE_PRICE_ATTRIBUTE_KEY\nProduct attribute key that flags items requiring remote price calculation. When any basket item carries this attribute, the flow redirects to the remote price calculation step after address selection.\n\n### IDENTITY_NUMBER_REQUIRED_AMOUNT\nWhen set, orders exceeding this total amount require a valid identity number in the shipping address before proceeding.\n\n### USER_PHONE_FORMAT\nDisplay format used as a placeholder for phone number input fields (for example, `05999999999`)."}],"servers":[{"description":"Akinon Checkout API","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com"}}}],"paths":{"/orders/checkout/?page=CheckoutProviderNotificationPage":{"post":{"tags":["Entry & Address"],"operationId":"submitCheckoutProviderNotificationPage","summary":"Process checkout provider payment notification and create the order","description":"Receives the payment notification from the checkout provider and creates\nthe order. This endpoint is called as a callback by the provider after the\ncustomer completes the payment on the hosted form. It validates the\nconversation ID, resolves or creates the customer account, saves addresses,\nsets the shipping option, configures installment data, and finalizes the\npre-order into a completed order.\n\n**Required Fields**: `agreements`, `conversation_id`, `payment_info`,\n`transaction`, `card_info`, `akifast_user`, `is_successful`\n\n**Optional Fields**: `shipping_address`, `billing_address`\n\n**Validation**:\n- `agreements` must be `true` (agreement acceptance required)\n- `conversation_id` must match the one stored in `pre_order.checkout_provider_data`\n- `is_successful` must be `true` (transaction must have succeeded)\n- `transaction.installment_count` must be between 1 and 12\n- `transaction.conversation_id` must match `pre_order.checkout_provider_data['conversation_id']`\n\n**State Updates**:\n- User account is resolved or created via social account login\n- Shipping and billing addresses are set and saved\n- `pre_order.shipping_option` set from `transaction.shipping_option_key`\n- `pre_order.shipping_amount` calculated for the selected option\n- `pre_order.payment_option` set to the first active credit card option\n- `pre_order.pos_alt` set from `payment_info.payment_system_code`\n- `pre_order.card_info` populated with the card BIN number\n- `pre_order.checkout_provider_data['installment_alt']` set with\n  `installment_count` and `interest_amount`\n- `pre_order.checkout_provider_data['checkout_provider_purchase_raw_response']` set\n- `pre_order.checkout_provider_data['use_three_d_secure']` set from `transaction.is_threed`\n- Order is finalized (pre-order converted to completed order)\n\n**Error Handling**:\n- If `is_successful` or `agreements` is `false`, a validation error is returned\n  and the order number is reset.\n\n**Next Page**: `CheckoutProviderThankYouPage`","parameters":[{"$ref":"#/components/parameters/AjaxRequestHeader"},{"$ref":"#/components/parameters/SessionCookieHeader"}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/AkifastOrderNotificationPageInput"}}}},"responses":{"200":{"description":"Order created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}}}}}},"components":{"parameters":{"AjaxRequestHeader":{"name":"x-requested-with","in":"header","required":true,"description":"Required header for AJAX requests. Must be set to `XMLHttpRequest` for all checkout requests.","schema":{"type":"string","enum":["XMLHttpRequest"],"default":"XMLHttpRequest"}},"SessionCookieHeader":{"name":"Cookie","in":"header","required":false,"description":"Session cookie header (e.g. `sessionid=abc123` or `osessionid=<session_id>`)","schema":{"type":"string"}}},"schemas":{"AkifastOrderNotificationPageInput":{"type":"object","description":"Payment notification payload sent by the checkout provider after the\ncustomer completes payment on the hosted form. Used to create the order,\nset shipping, link the customer account, and finalize the pre-order.","required":["agreements","conversation_id","payment_info","transaction","card_info","akifast_user","is_successful"],"properties":{"agreements":{"type":"boolean","enum":[true],"description":"Customer's acceptance of the agreement. Must be `true`; any other value returns a validation error."},"is_successful":{"type":"boolean","enum":[true],"description":"Payment success flag from the provider. Must be `true`; any other value returns a validation error."},"conversation_id":{"type":"string","description":"Provider conversation identifier. Must match `pre_order.checkout_provider_data['conversation_id']`."},"payment_info":{"type":"object","required":["payment_system_code"],"properties":{"payment_system_code":{"type":"string","description":"Slug of the POS (payment system) used for the transaction. Must match an existing POS record."}}},"transaction":{"$ref":"#/components/schemas/AkifastNotificationTransaction"},"card_info":{"type":"array","items":{"$ref":"#/components/schemas/AkifastCardInfo"},"description":"List of card details. At minimum the first item's BIN is used."},"shipping_address":{"$ref":"#/components/schemas/AkifastAddressField"},"billing_address":{"$ref":"#/components/schemas/AkifastAddressField"},"akifast_user":{"$ref":"#/components/schemas/AkifastUserField"}}},"AkifastNotificationTransaction":{"type":"object","required":["installment_count","interest_amount","total_paid_amount","payment_system_raw_response","shipping_option_key","is_threed"],"properties":{"installment_count":{"type":"integer","minimum":1,"maximum":12,"description":"Number of instalments selected for the payment."},"interest_rate":{"type":"number","format":"float","minimum":0,"maximum":100,"description":"Interest rate applied (as a percentage). Optional."},"interest_amount":{"type":"number","format":"float","description":"Total interest amount charged."},"total_paid_amount":{"type":"number","format":"float","description":"Total amount charged to the customer including interest."},"payment_system_raw_response":{"type":"string","description":"Raw response payload from the payment processor, as a string."},"shipping_option_key":{"type":"integer","description":"Primary key of the shipping option selected during the provider flow. Must be one of the available shipping options for the pre-order."},"is_threed":{"type":"boolean","description":"Whether the transaction was secured with 3D Secure authentication."}}},"AkifastCardInfo":{"type":"object","required":["bin"],"properties":{"bin":{"type":"string","minLength":6,"maxLength":8,"description":"Bank Identification Number (BIN) of the card used for payment. Must be 6 or 8 digits."}}},"AkifastAddressField":{"type":"object","required":["name","surname","phone_number","address_title","line","hash_data","country","city","town","district"],"properties":{"name":{"type":"string","description":"First name of the address holder."},"surname":{"type":"string","description":"Last name of the address holder."},"phone_number":{"type":"string","description":"Phone number of the address holder."},"postal_code":{"type":["string","null"],"description":"Postal code. Optional."},"address_title":{"type":"string","description":"Short label for the address (e.g. \"Home\", \"Work\")."},"tax_no":{"type":["string","null"],"description":"Tax number. Required for corporate addresses."},"tax_office":{"type":["string","null"],"description":"Tax office name. Required for corporate addresses."},"company_name":{"type":["string","null"],"description":"Company name. Required for corporate addresses."},"line":{"type":"string","description":"Full street address line."},"address_type":{"type":["string","null"],"description":"Address type (`\"individual\"` or `\"corporate\"`). Mapped to lowercase internally."},"notes":{"type":["string","null"],"description":"Optional delivery notes."},"hash_data":{"type":"string","description":"Provider-generated hash string used to verify address integrity. Stored in the address `extra_field` as `remote_hash`."},"country":{"$ref":"#/components/schemas/AkifastAddressSubField"},"city":{"$ref":"#/components/schemas/AkifastAddressSubField"},"town":{"$ref":"#/components/schemas/AkifastAddressSubField"},"district":{"$ref":"#/components/schemas/AkifastAddressSubField"}}},"AkifastAddressSubField":{"type":"object","required":["name","code"],"properties":{"name":{"type":"string","description":"Human-readable name of the geographic unit."},"code":{"type":"string","description":"Provider-specific code for the geographic unit."}}},"AkifastUserField":{"type":"object","required":["akinon_user_id","name","surname","email"],"properties":{"akinon_user_id":{"type":"string","maxLength":255,"description":"Provider-assigned unique user identifier."},"name":{"type":"string","maxLength":255,"description":"First name of the user."},"surname":{"type":"string","maxLength":255,"description":"Last name of the user."},"identity_number":{"type":["string","null"],"maxLength":255,"description":"National identity number. Optional."},"email":{"type":"string","format":"email","description":"Email address. Normalized to lowercase."},"phone_number":{"type":["string","null"],"maxLength":255,"description":"Phone number. Optional."},"status":{"type":["string","null"],"maxLength":255,"description":"User status from the provider. Optional."},"verification_status":{"type":["string","null"],"maxLength":255,"description":"Identity verification status. Optional."},"verification_date":{"type":["string","null"],"maxLength":255,"description":"Date when identity was verified. Optional."},"gender":{"type":["string","null"],"maxLength":255,"description":"Gender. Optional."},"email_verified":{"type":["boolean","null"],"description":"Whether the email address has been verified by the provider."},"birth_date":{"type":["string","null"],"maxLength":255,"description":"Date of birth. Optional."}}},"CheckoutResponse":{"type":"object","properties":{"context_list":{"type":"array","items":{"$ref":"#/components/schemas/PageContext"}},"pre_order":{"$ref":"#/components/schemas/PreOrder"},"errors":{"oneOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"},{"type":"array","items":{"type":"string"}}]},"template_name":{"type":"string"}}},"PageContext":{"type":"object","properties":{"page_name":{"type":"string","description":"Class name of the page (e.g., \"IndexPage\", \"AddressSelectionPage\")"},"page_slug":{"type":"string","description":"URL-friendly slug for the page"},"page_context":{"type":"object","description":"Page-specific context data","additionalProperties":true}}},"PreOrder":{"type":"object","description":"Pre-order state containing basket, addresses, shipping, payment information","properties":{"basket":{"$ref":"#/components/schemas/Basket"},"shipping_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"billing_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"shipping_option":{"oneOf":[{"$ref":"#/components/schemas/ShippingOptionDetail"},{"type":"null"}]},"billing_and_shipping_same":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"payment_option":{"oneOf":[{"$ref":"#/components/schemas/PaymentOptionDetail"},{"type":"null"}]},"notifications":{"type":"array","items":{"type":"object"}},"shipping_amount":{"oneOf":[{"type":"string","pattern":"^\\d+\\.\\d{2}$"},{"type":"null"}]},"total_amount":{"oneOf":[{"type":"string","pattern":"^\\d+\\.\\d{2}$"},{"type":"null"}]},"unpaid_amount":{"oneOf":[{"type":"string","pattern":"^\\d+\\.\\d{2}$"},{"type":"null"}]},"loyalty_money":{"oneOf":[{"type":"string","pattern":"^\\d+\\.\\d{2}$"},{"type":"null"}]},"currency_type_label":{"type":"string"},"installment":{"oneOf":[{"$ref":"#/components/schemas/Installment"},{"type":"null"}]},"card_info":{"oneOf":[{"type":"object","description":"Card information from BIN lookup","properties":{"bin_number":{"type":"string","description":"Card BIN (first 6-8 digits)"},"card":{"type":"object","description":"Card details from BIN database","properties":{"pk":{"type":"integer"},"name":{"type":"string","description":"Card type name (e.g., \"Visa\", \"Mastercard\")"}}}}},{"type":"null"}]},"redirect_to_three_d":{"oneOf":[{"type":"boolean"},{"type":"null"}]},"delivery_option":{"oneOf":[{"$ref":"#/components/schemas/DeliveryOption"},{"type":"null"}]},"retail_store":{"oneOf":[{"$ref":"#/components/schemas/RetailStore"},{"type":"null"}]},"funds_transfer_bank":{"oneOf":[{"$ref":"#/components/schemas/BankAccount"},{"type":"null"}]},"number":{"oneOf":[{"type":"string","description":"Pre-order/order number"},{"type":"null"}]},"order":{"oneOf":[{"type":"object","description":"Created order (after checkout completion)","properties":{"pk":{"type":"integer"},"number":{"type":"string"},"status":{"type":"string"}}},{"type":"null"}]},"payment_choice":{"oneOf":[{"$ref":"#/components/schemas/PaymentChoice"},{"type":"null"}]},"user_email":{"oneOf":[{"type":"string"},{"type":"null"}]},"phone_number":{"oneOf":[{"type":"string"},{"type":"null"}]},"user_phone_number":{"oneOf":[{"type":"string"},{"type":"null"}]},"gift_box":{"oneOf":[{"type":"object","properties":{"note":{"type":"string"},"gift_video":{"type":"boolean"},"gift_video_notification_sent":{"type":"boolean"},"price":{"type":"string"}}},{"type":"null"}]},"delivery_range":{"oneOf":[{"type":"object","properties":{"lower":{"type":"string","format":"date-time"},"upper":{"type":"string","format":"date-time"}}},{"type":"null"}]},"total_amount_with_interest":{"oneOf":[{"type":"string","pattern":"^\\d+\\.\\d{2}$"},{"type":"null"}]},"is_guest":{"type":"boolean"},"is_post_order":{"type":"boolean"},"data_source_shipping_options":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/DataSourceShippingOptionDetail"}},{"type":"null"}]},"attribute_based_shipping_options":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/PreOrderAttributeBasedShippingOption"}},{"type":"null"}]}}},"Basket":{"type":"object","properties":{"pk":{"type":"integer"},"total_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$"}}},"Address":{"type":"object","properties":{"pk":{"type":"integer"},"email":{"type":"string"},"phone_number":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"country":{"$ref":"#/components/schemas/Country"},"city":{"$ref":"#/components/schemas/City"},"line":{"type":"string"},"title":{"type":"string"},"township":{"$ref":"#/components/schemas/Township"},"district":{"oneOf":[{"$ref":"#/components/schemas/District"},{"type":"null"}]},"postcode":{"type":"string"},"notes":{"type":"string"},"company_name":{"type":"string"},"tax_office":{"type":"string"},"tax_no":{"type":"string"},"e_bill_taxpayer":{"type":"boolean"},"is_corporate":{"type":"boolean"},"primary":{"type":"boolean"},"identity_number":{"type":"string"}}},"Country":{"type":"object","properties":{"pk":{"type":"integer"},"code":{"type":"string"},"name":{"type":"string"}}},"City":{"type":"object","properties":{"pk":{"type":"integer"},"name":{"type":"string"}}},"Township":{"type":"object","properties":{"pk":{"type":"integer"},"name":{"type":"string"}}},"District":{"type":"object","properties":{"pk":{"type":"integer"},"name":{"type":"string"}}},"ShippingOptionDetail":{"type":"object","description":"Detailed shipping option with calculated amount","properties":{"pk":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"oneOf":[{"type":"string","format":"uri"},{"type":"null"}]},"shipping_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$"},"description":{"oneOf":[{"type":"string"},{"type":"null"}]},"kwargs":{"type":"object","additionalProperties":true}}},"PaymentOptionDetail":{"type":"object","description":"Detailed payment option with type information","properties":{"pk":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"payment_type":{"type":"string","enum":["credit_card","funds_transfer","bkm_express","loyalty_money","cash_register","gpay","redirection","stored_card","masterpass","masterpass_rest","credit_payment","pay_later","saved_card","confirmation","b2b","wallet","pay_on_delivery"]},"payment_type_label":{"type":"string"}}},"Installment":{"type":"object","properties":{"pk":{"type":"integer"},"installment_count":{"type":"integer"},"label":{"type":"string"},"price_with_accrued_interest":{"type":"string","pattern":"^\\d+\\.\\d{2}$"},"monthly_price_with_accrued_interest":{"type":"string","pattern":"^\\d+\\.\\d{2}$"}}},"DeliveryOption":{"type":"object","properties":{"pk":{"type":"integer"},"name":{"type":"string"},"delivery_option_type":{"type":"string","enum":["customer","retail_store","pickup_location"]},"is_active":{"type":"boolean"}}},"RetailStore":{"type":"object","properties":{"pk":{"type":"integer"},"name":{"type":"string"},"erp_code":{"type":"string"},"township":{"$ref":"#/components/schemas/Township"},"click_and_collect":{"type":"boolean"},"is_active":{"type":"boolean"}}},"BankAccount":{"type":"object","description":"Bank account for funds transfer payments","properties":{"pk":{"type":"integer"},"bank_name":{"type":"string","description":"Name of the bank"},"account_holder":{"type":"string","description":"Account holder name"},"iban":{"type":"string","description":"International Bank Account Number"},"currency":{"type":"string","description":"Currency code (e.g., \"USD\", \"EUR\", \"TRY\")"},"is_active":{"type":"boolean"}}},"PaymentChoice":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"price":{"type":"string","pattern":"^\\d+\\.\\d{2}$"}}},"DataSourceShippingOptionDetail":{"type":"object","description":"Data source shipping option for multi-vendor shipping","properties":{"pk":{"type":"integer"},"shipping_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$"},"shipping_option_name":{"type":"string"},"shipping_option_logo":{"oneOf":[{"type":"string","format":"uri"},{"type":"null"}]},"data_source":{"type":"object","properties":{"pk":{"type":"integer"},"title":{"type":"string"}}},"description":{"oneOf":[{"type":"string"},{"type":"null"}]}}},"PreOrderAttributeBasedShippingOption":{"type":"object","description":"Attribute-based shipping option selected for a product group","properties":{"pk":{"type":"integer"},"shipping_option_name":{"type":"string"},"shipping_option_logo":{"oneOf":[{"type":"string","format":"uri"},{"type":"null"}]},"shipping_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$"},"product_ids":{"type":"array","items":{"type":"integer"}},"attribute_value":{"type":"string"},"attribute_key":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://apidocs.akinon.com/commerce-openapis/checkout/entry-and-address/process-checkout-provider-payment-notification-and-create-the-order.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
