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

Submit agreement acceptance and shipping/address data from checkout provider

Accepts the customer's agreement selection along with shipping option, address, and user data forwarded from the checkout provider's hosted form. Sets the payment option to credit card, assigns the shipping option and amount, and records the selected agreement code on the pre-order.

Required Fields: basket_id, session_token, shipping_option_key, user, code

Optional Fields: shipping_address, billing_address

State Updates:

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

  • pre_order.payment_choice cleared

  • pre_order.shipping_option set from shipping_option_key

  • pre_order.shipping_amount calculated for the selected shipping option

  • pre_order.data['selected_agreement'] set to the submitted code

  • pre_order.shipping_address.email set from user.email

Backward Navigation:

  • Clears selected_agreement, payment_option, shipping_option, and resets shipping_amount to 0.00.

Next Page: CheckoutProviderNotificationPage

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

Payload posted back from the checkout provider's agreement selection step. Includes the selected agreement code, shipping option, address data, and user information. Sets payment option, shipping, and records the agreement on the pre-order.

basket_idintegerRequired

Primary key of the active basket.

Example: 42
session_tokenstring · uuidRequired

Session token issued by the checkout provider for this session.

Example: 550e8400-e29b-41d4-a716-446655440000
shipping_option_keyintegerRequired

Primary key of the selected shipping option. Must be one of the available shipping options for the pre-order's address.

Example: 1
codestring · enumRequired

Agreement type accepted by the customer. info for the preliminary information form; sales for the distance sales agreement.

Example: salesPossible values:
Responses
200

Agreement data saved

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

"basket_id=42&session_token='550e8400-e29b-41d4-a716-446655440000'&shipping_option_key=1&code='sales'&user={'akinon_user_id':'user-id-123','name':'John','surname':'Doe','email':'user@example.com'}"
200

Agreement data saved

{
  "context_list": [
    {
      "page_name": "CheckoutProviderNotificationPage",
      "page_slug": "checkoutprovidernotificationpage",
      "page_context": {
        "code": "sales",
        "text": "Distance Sales Agreement",
        "agreement_body": "<p>Agreement content...</p>"
      }
    }
  ],
  "pre_order": {
    "user_email": "user@akinon.com"
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?