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

Select Pay on Delivery Payment Choice

Saves the user's selected payment choice for pay-on-delivery.

Required Fields:

  • payment_choice: The value string of one of the items returned in payment_choices from the GET context. Submitting a value not present in that list causes a validation error.

Validation:

  • Basket amount must be greater than zero

  • payment_choice must match one of the valid values returned by the payment option's choices

State Update:

  • pre_order.payment_choice is set to the selected PaymentChoice object

Next Pages:

  • SendSmsPage — when the payment option's sms_verification configuration is true

  • PayOnDeliveryPage — in all other cases

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_choicestringRequired

The value string of one of the payment choices returned in the payment_choices list from the GET context of PayOnDeliveryPaymentChoicePage. Submitting a value not present in that list causes a validation error.

Example: cash
Responses
200

Payment choice selected successfully

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

"payment_choice='cash'"
200

Payment choice selected successfully

{
  "context_list": [
    {
      "page_name": "PayOnDeliveryPage",
      "page_slug": "payondeliverypage",
      "page_context": {}
    }
  ],
  "pre_order": {
    "basket": {
      "pk": 123,
      "total_amount": "150.00"
    },
    "payment_option": {
      "pk": 4,
      "name": "Pay on Delivery",
      "slug": "pay-on-delivery",
      "payment_type": "pay_on_delivery",
      "payment_type_label": "Pay on Delivery"
    },
    "payment_choice": {
      "value": "cash",
      "label": "Cash",
      "price": "0.00"
    },
    "total_amount": "150.00",
    "currency_type_label": "TRY"
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?