Select a checkout provider and start a hosted payment session
Selects a checkout provider for the pre-order and calls the provider's session start endpoint. On success, the pre-order receives a remote_redirect_url pointing to the provider's hosted checkout form, along with a transaction_id and conversation_id for subsequent steps.
Required Fields: checkout_provider
State Updates:
pre_order.checkout_providerset to the selected providerpre_order.retail_storeclearedpre_order.delivery_optionset to the first customer delivery optionpre_order.loyalty_amount_to_usereset to0pre_order.data['redirection_started'] = truepre_order.data['remote_redirect_url']set to the provider's hosted URLpre_order.data['transaction_id']setpre_order.checkout_provider_data['conversation_id']set
Backward Navigation:
Clears
checkout_provider,remote_redirect_url,transaction_id,redirection_started, andcheckout_provider_datafrom the pre-order.
Error Conditions:
Returns
400withnon_field_errorsif the provider's session start fails.
Next Page: CheckoutProviderAddressSelectionPage
Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.
XMLHttpRequestPossible values: Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)
Payload for selecting a checkout provider (e.g. Akifast) to use for the current order. The submitted provider must be available for the pre-order.
Primary key of the checkout provider to select. Only providers that are currently available for the pre-order are accepted.
1Provider selected and session started
POST /orders/checkout/?page=CheckoutProviderSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 23
"checkout_provider=1"Provider selected and session started
{
"context_list": [
{
"page_name": "CheckoutProviderAddressSelectionPage",
"page_slug": "checkoutprovideraddressselectionpage",
"page_context": {
"redirect_url": "https://akifast.example.com/checkout/abc123",
"is_iframe": false
}
}
],
"pre_order": {
"user_email": "user@akinon.com"
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

