Checkout Provider
External checkout provider integration endpoints
Processes a checkout step using an external checkout provider (e.g., Akifast).
How It Works:
Send
basket_idin request body and specify the page via?page=query parameter.Each page performs specific operations and returns context data for the next step.
The checkout flow is stateful - each step builds on the previous one.
On the final step, the order is created.
Checkout Flow Pages
1. CheckoutProviderIndexPage
Initializes the checkout flow. Call this first to start the process.
2. CheckoutProviderSelectionPage
User selects which checkout provider to use (e.g., Akifast).
What happens on this step:
The selected checkout provider is validated and saved to the order.
Delivery option is set to "customer" (home delivery).
Any loyalty points usage is reset to zero.
A payment session is started with the external provider.
Callback URLs are registered for the provider to send data back.
A
redirect_urlis generated for the provider's hosted checkout page.A
conversation_idis stored for security verification in subsequent steps.
On success: User should be redirected to the redirect_url to continue checkout on the provider's page.
3. CheckoutProviderAddressSelectionPage
Receives address data from the checkout provider's callback. The provider sends shipping and billing address information which gets saved to the order.
4. CheckoutProviderShippingOptionPage
Returns available shipping options for the delivery address. The conversation_id must match the one from the payment session for security.
5. CheckoutProviderAgreementListPage
User selects a shipping option and views the terms & conditions. The shipping cost is calculated based on the selected option.
6. CheckoutProviderNotificationPage
Receives payment confirmation from the provider and creates the order.
Important: The basket is validated to ensure it hasn't changed during checkout. If items were added, removed, or quantities changed, the order creation fails.
7. CheckoutProviderThankYouPage (Final Response)
After successful order creation, this page's context is returned.
Response contains:
return_url: Signed URL to the order completion pagemerchant_customer_id: Customer's unique IDmerchant_customer_date_joined: Customer's registration datemerchant_customer_akifast_date_joined: Date when customer linked their account with the provider
Error Handling:
If basket changes during checkout → 400 error
If order creation fails → System attempts fallback order creation
The checkout page/step to process.
CSRF token for write operations (POST, PUT, PATCH, DELETE). Required for security when using session authentication. Obtain token from cookie 'csrftoken' or meta tag in HTML.
abc123def456ghi789Session ID and CSRF token cookies.
Format: sessionid=<id>; osessionid=<id>; csrftoken=<token>
sessionid=abc123def456; osessionid=abc123def456; csrftoken=xyz789Checkout step processed successfully.
Important: On success, the response contains the next page's data, not the current page's. This allows the client to proceed to the next step with the required data.
| Request Page | Response Contains |
|---|---|
CheckoutProviderIndexPage |
CheckoutProviderSelectionPage context |
CheckoutProviderSelectionPage |
CheckoutProviderAddressSelectionPage context |
CheckoutProviderAddressSelectionPage |
CheckoutProviderShippingOptionPage context |
CheckoutProviderShippingOptionPage |
CheckoutProviderAgreementListPage context |
CheckoutProviderAgreementListPage |
CheckoutProviderNotificationPage context |
CheckoutProviderNotificationPage |
CheckoutProviderThankYouPage context (order completion) |
Validation error, basket changed, or processing error. The response contains error details in a field-keyed format.
Returns a list of available external checkout providers.
Business Logic:
Returns cached provider configurations for performance.
Cache is refreshed every few minutes (L0: 1min, L1: 2min, L2: 4min).
Providers include payment gateways and wallet services.
Only active providers are returned.
List of checkout providers
List of checkout providers
Retrieves the details of a completed order after checkout provider flow.
Business Logic:
Validates the signed order number to prevent unauthorized access.
The signature is time-limited for security.
Returns order details including items, campaigns, and rewards.
Response Format:
Default: HTML page rendering order confirmation.
JSON: Add
?format=jsonquery parameter.
Signed order number (time-limited signature for security).
Response format. Use json for JSON response.
Order details
HTML page with order confirmation.
Order not found or signature expired/invalid
Cancels the current checkout provider flow and returns to the basket page.
Business Logic:
Destroys the pre-order data from the session.
Redirects the user to the basket page.
Used when the user abandons the checkout process or payment fails.
Trigger Scenarios:
User clicks "Cancel" on external payment page.
Payment fails at the provider.
User closes the payment window.
Redirects to the basket page
Redirects to the basket page
No content
Last updated
Was this helpful?

