# Order validation

> `POST https://api.kustom.co/merchant_urls.validation`

Will be called before completing the purchase to validate the information provided by the consumer in Kustom's Checkout iframe.

## Request body

`application/json`

- `order_id` (string) — Unique order ID that will be used for the entire lifecycle of the order. (max 255 characters)
- `name` (string) — The merchant name (max 255 characters).
- `purchase_country` (string, required) — The purchase country of the merchant's store. The format to be used is ISO 3166 alpha-2. Eg: GB, SE, DE, US, etc.

  Note: purchase country and currency need to match the defined merchant configuration. For global configuration see more details [here](/contents/checkout/use-cases/selling-to-multiple-countries/)
- `purchase_currency` (string, required) — The purchase currency of the merchant's store. The format to be used is ISO 4217. Eg: USD, EUR, SEK, GBP, etc.

  Note: purchase country and currency need to match the defined merchant configuration. For global configuration see more details [here](/contents/checkout/use-cases/selling-to-multiple-countries/)
- `locale` (string, required) — Used to define the language and region of the customer. RFC 1766 customer's locale.
- `status` (string) — The current status of the order. The status will be ‘incomplete’ until the customer has been successfully authorized.
- `billing_address` (object)
  - `given_name` (string) — Given name.
  - `family_name` (string) — Family name.
  - `organization_name` (string) — Organization name. Only applicable for orders with customer.type="organization".
  - `email` (string) — E-mail address.
  - `title` (string) — Title.
    Valid values for UK:

    - *Mr*
    - *Ms*
    - *Mrs*
    - *Miss*

    Valid values for DACH:

    - *Herr*
    - *Frau*

    Valid values for NL:

    - *Dhr.*
    - *Mevr.*
  - `street_address` (string) — Street address, first line. (Street name and number)
  - `street_address2` (string) — Street address, second line. (Apartment number, suite, etc.)
  - `street_name` (string) — Street name. Only applicable in DE/AT/NL. Do not combine with street_address. See **streetNumber**.
  - `street_number` (string) — Street number. Only applicable in DE/AT/NL. Do not combine with street_address. See **streetName**.
  - `house_extension` (string) — House extension. Only applicable in NL
  - `postal_code` (string) — Postal/post code.
  - `city` (string) — City.
  - `region` (string) — State or Region.
  - `phone` (string) — Phone number.
  - `country` (string) — ISO 3166 alpha-2. Country.
  - `care_of` (string) — Care of.
- `shipping_address` (object) Same shape as `billing_address`.
- `order_amount` (integer, required) — Total amount of the order including tax and any available discounts. The value should be in non-negative minor units.

  Example: 25 Euros should be 2500.
- `order_tax_amount` (integer, required) — Total tax amount of the order. The value should be in non-negative minor units.

  Example: 25 Euros should be 2500.
- `order_lines[]` (array<object>, required) — An array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order.
  - `type` (string) — Type of the order line item. The possible values are:

    - *physical (physical good)*
    - *discount*
    - *shipping_fee*
    - *sales_tax (depends on the country/city, usually called VAT)*
    - *digital (digital good)*
    - *gift_card*
    - *store_credit (credit from the merchant)*
    - *surcharge (extra charge)*
  - `reference` (string) — Article number, SKU or similar. (max 255 characters)
  - `name` (string, required) — Descriptive name of the order line item (max 255 characters)
  - `quantity` (integer, required) — Non-negative number. Quantity of the order line item.
  - `subscription` (object) — Describes the subscription.
    Including subscription details will also change the buy button to inform the user that they will be subscribing.
    (Only applicable for recurring orders)
    - `name` (string) — The name of the subscription product.

      Example: "Premium Account"
    - `interval` (string, required) — The cadence unit for this.

      Example: "DAY"
      Enum: `DAY`, `WEEK`, `MONTH`, `YEAR`.
    - `interval_count` (integer, required) — The number of intervals.

      Example: 30
  - `quantity_unit` (string) — Unit used to describe the quantity, e.g. kg, pcs... If defined has to be 1-8 characters
  - `unit_price` (integer, required) — Minor units. Includes tax, excludes discount. (max value: 100000000).

    Example: 100 Euros should be 10000.
  - `tax_rate` (integer, required) — Non-negative value. The percentage value is represented with two implicit decimals. (max 10000)

    Example: 25% should be 2500.
  - `total_amount` (integer, required) — Minor units. Includes tax and discount.

    Example: 25 euros should be 2500
    Value = (quantity x unit_price) - total_discount_amount.
    (max value: 100000000)
  - `total_discount_amount` (integer) — Non-negative minor units. Includes tax.

    Example: 25 euros should be 2500
  - `total_tax_amount` (integer, required) — Must be within ±1 of total_amount - total_amount \* 10000 / (10000 + tax_rate). Negative when type is discount.
  - `merchant_data` (string) — Property used to store additional metadata per item that will be returned whenever an order is read from Kustom. Pass through field. (max 1024 characters).
  - `product_url` (string) — URL to the product page that can be later embedded in communications between Kustom and the customer. (max 1024 characters)
  - `image_url` (string) — URL to an image that can be later embedded in communications between Kustom and the customer. (max 1024 characters)

    Improves post-purchase customer experiences.
  - `product_identifiers` (object)
    - `brand` (string) — The product's brand name as generally recognized by consumers. If no brand is available for a product, do not supply any value.
    - `color` (string) — Color to be shown to the end customer (max 64 characters).
    - `category_path` (string) — The product's category path as used in the merchant's webshop. Include the full and most detailed category and separate the segments with ' > '. (max 750 characters)

      Example: "Electronics Store > Computers & Tablets > Desktops"
    - `global_trade_item_number` (string) — The product's Global Trade Item Number (GTIN). Common types of GTIN are EAN, ISBN or UPC. Exclude dashes and spaces, where possible
    - `manufacturer_part_number` (string) — The product's Manufacturer Part Number (MPN), which - together with the brand - uniquely identifies a product. Only submit MPNs assigned by a manufacturer and use the most specific MPN possible
    - `size` (string) — Size to be shown to the end customer (max 64 characters).
  - `shipping_attributes` (object)
    - `weight` (integer) — The product's weight as used in the merchant's webshop. Non-negative. Measured in grams.
    - `dimensions` (object)
      - `height` (integer) — The product's height as used in the merchant's webshop. Non-negative. Measured in millimeters.
      - `width` (integer) — The product's width as used in the merchant's webshop. Non-negative. Measured in millimeters.
      - `length` (integer) — The product's length as used in the merchant's webshop. Non-negative. Measured in millimeters.
    - `tags[]` (array<string>) — The product's extra features, example ["dangerous_goods", "bulky"]
    - `delivery_id` (string) — The ID of the delivery this item belongs to. The delivery ID must be defined in the `deliveries` array of the order.
- `customer` (object)
  - `type` (string) — The default supported value is 'person'. If B2B is enabled for the merchant, the value may be "organization".
  - `gender` (string) — Customer’s gender - ‘male’ or ‘female’.
  - `date_of_birth` (string) — Customer’s date of birth. The format is ‘yyyy-mm-dd’. ISO 8601 date.
  - `organization_registration_id` (string) — "The organization's official registration id (organization number).

    Note: Applicable only for B2B orders."
  - `vat_id` (string) — Organization VAT ID. Only applies for b2b orders.
- `merchant_urls` (object)
  - `terms` (string, required) — URL for the terms and conditions page of the merchant. The URL will be displayed inside the Kustom Checkout iFrame.(max 2000 characters)
    Example: "https://merchant.com/terms"
  - `checkout` (string, required) — URL for the checkout page of the merchant. (max 2000 characters)
    Example: "https://merchant.com/checkout"
  - `confirmation` (string, required) — URL of the merchant confirmation page. The consumer will be redirected back to the confirmation page if the authorization is successful after the customer clicks on the ‘Place Order’ button inside checkout. The special characters of the confirmation URL should be encoded, e.g. the "space" character should be written as "%20". Then, on top of that, the whole confirmation URL should be encoded. E.g. the "space" character should become "%2520". (max 2000 characters)
    Example: "https://merchant.com/confirmation"
  - `push` (string, required) — URL that will be used for push notification when an order is completed. Should be different than checkout and confirmation URLs. (max 2000 characters)
    Example: "https://merchant.com/push"
  - `validation` (string) — URL that will be requested for final merchant validation. (must be https, max 2000 characters)
    Example: "https://merchant.com/validation"
  - `notification` (string) — URL for notifications on pending orders. (max 2000 characters)
    Example: "https://merchant.com/notification/{checkout.order.id}"
  - `cancellation_terms` (string) — URL for the cancellation terms page of the merchant. The URL will be displayed in the email that is sent to the customer after the order is captured.(max 2000 characters)
    Example: "https://merchant.com/terms/cancelation"
  - `shipping_option_update` (string) — URL for shipping option update. (must be https, max 2000 characters)
    Example: "https://merchant.com/shippingoptionupdate"
  - `address_update` (string) — URL for shipping, tax and purchase currency updates. Will be called on address changes. (must be https, max 2000 characters)
    Example: "https://merchant.com/addressupdate"
  - `country_change` (string) — URL for shipping, tax and purchase currency updates. Will be called on billing or shipping country changes. (must be https, max 2000 characters)
    Example: "https://merchant.com/countrychange"
  - `upsell` (string) — URL for upsell. Will be called on upsell. This must be enabled for the merchant to use. (must be https, max 2000 characters)
    Example: "https://merchant.com/upsell"
  - `upsell_validation` (string) — URL for upsell validation when a completed order is attempted to add upsell.
    Example: "https://merchant.com/upsell-validation"
  - `upsell_notification` (string) — URL for notification after order updated with upsell. (must be https, max 2000 characters)
    Example: "https://merchant.com/upsell/{checkout.order.id}"
- `html_snippet` (string) — The HTML snippet that is used to render the checkout in an iframe.
- `merchant_reference1` (string) — Used for storing merchant's internal order number or other reference. If set, will be shown on the confirmation page as "order number" . The value is also available in the settlement files. (max 255 characters).
  Example: "45aa52f387871e3a210645d4"
- `merchant_reference2` (string) — Used for storing merchant's internal order number or other reference. The value is available in the settlement files. (max 255 characters).
  Example: "45aa52f387871e3a210645d4"
- `started_at` (string) — ISO 8601 datetime. The date and time when the order has been created. The format will be as follows:
  "yyyy-mm-ddThh:mm:ssZ"
- `completed_at` (string) — ISO 8601 datetime. The date and time when the order has been completed. The format will be as follows:
  "yyyy-mm-ddThh:mm:ssZ"
- `last_modified_at` (string) — ISO 8601 datetime. The date and time when the order was last modified. The format will be as follows:
  "yyyy-mm-ddThh:mm:ssZ"
- `options` (object)
  - `require_validate_callback_success` (boolean) — If true, validate callback must get a positive response to not stop purchase. Default: false.
  - `acquiring_channel` (string) — Acquiring channel for the order. The possible values are:

    - *ECOMMERCE for "E-commerce"*
    - *IN_STORE for "Purchase in boutique"*
    - *Default : ECOMMERCE*
  - `vat_removed` (boolean) — If true, VAT is not displayed in Checkout's Order Summary page.
  - `tms_configuration_override` (object)
    - `disabled` (boolean) — If true, the TMS integration will be disabled for this session.
  - `allow_separate_shipping_address` (boolean) — If true, the consumer can enter different billing and shipping addresses. Default: false, except for purchase_country DE where default is: true
  - `color_button` (string) — Color for the buttons within the iFrame. Value should be a CSS hex color, e.g. "#FF9900"
  - `color_button_text` (string) — Color for the text inside the buttons within the iFrame. Value should be a CSS hex color, e.g. "#FF9900"
  - `color_checkbox` (string) — Color for the checkboxes within the iFrame. Value should be a CSS hex color, e.g. "#FF9900"
  - `color_checkbox_checkmark` (string) — Color for the checkboxes checkmark within the iFrame. Value should be a CSS hex color, e.g. "#FF9900"
  - `color_header` (string) — Color for the headers within the iFrame. Value should be a CSS hex color, e.g. "#FF9900"
  - `color_link` (string) — Color for the hyperlinks within the iFrame. Value should be a CSS hex color, e.g. "#FF9900"
  - `color_background` (string) — Color for the background within the iFrame. Value should be a CSS hex color, e.g. "#FF9900"
  - `date_of_birth_mandatory` (boolean) — If true, the consumer cannot skip date of birth. Default: false
  - `date_of_birth_optional` (boolean) — If true, the consumer are able to enter date of birth, but can skip it. Default: false
  - `shipping_details` (string) — A message that will be presented on the confirmation page under the headline "Delivery" (max 255 characters).
  - `title_mandatory` (boolean) — If specified to false, title becomes optional. Only available for orders for country GB.
  - `additional_checkbox` (object)
    - `text` (string, required) — Text that will be displayed to the consumer aside the checkbox. Links and formatting can be added using Markdown. (max 1000 characters)
    - `checked` (boolean, required) — Default state of the additional checkbox. It will use this value when loaded for the first time.
    - `required` (boolean, required) — Whether it is required for the consumer to check the additional checkbox box or not in order to complete the purchase.
  - `national_identification_number_mandatory` (boolean) — If true, the user cannot skip national identification number in SE, NO, FI and DK. Default: false. In order to read the national identification number in the validation callback, please contact Kustom’s merchant support.
  - `additional_merchant_terms` (string) — Additional merchant defined field. e.g. Extra terms and conditions to show.

    Example: "ADDITIONAL MERCHANT TERMS! \[terms link\](https://merchant.com/extra_terms)"
  - `phone_mandatory` (boolean) — If false, the consumer can skip the phone. Only available for orders in DACH countries.
  - `radius_border` (string) — Radius for the border of elements within the iFrame.
  - `allowed_customer_types[]` (array<string>) — A list of allowed customer types. Supported types: **person** & **organization**.
    Example: ["person","organization"]
  - `show_subtotal_detail` (boolean) — If true, the Order Detail subtotals view is expanded when the Kustom Checkout iFrame is loaded. Default: false
  - `additional_checkboxes[]` (array<object>)
    - `text` (string, required) — Text that will be displayed to the consumer aside the checkbox. Links and formatting can be added using Markdown. (max 1000 characters)
    - `checked` (boolean, required) — Default state of the additional checkbox. It will use this value when loaded for the first time.
    - `required` (boolean, required) — Whether it is required for the consumer to check the additional checkbox box or not in order to complete the purchase.
    - `id` (string, required) — Identifier used when presenting data back to merchant
  - `verify_national_identification_number` (boolean) — Enable verification of National Identification Numbers only in Sweden and Norway. This option also make the national identification number mandatory. (Not applicable for countries outside of Sweden and Norway)
  - `auto_capture` (boolean) — Allow merchant to trigger auto capturing.
  - `require_client_validation` (boolean) — If true, a client side validation is needed to complete the purchase
  - `show_vat_registration_number_field` (boolean) — If true, a optional VAT registration number field will be shown in the address form. Only applies for b2b orders.
  - `analytics_enabled` (boolean) — If true, front end analytics are enabled at checkout. Default: false
  - `confirmation_page_upsell` (boolean) — If true, upsell recommendations will be presented on the order confirmation page
  - `subscription_buy_button` (boolean) — If true, the buy button will show 'Subscribe' instead of 'Buy' to indicate a subscription purchase
- `attachment` (object)
  - `body` (string, required) — The content of the extra merchant data which should be presented as a string inside this property. The body should be an object containing any of the keys and sub objects described below serialised to JSON. More information on that object can be found [here](https://docs.kustom.co/contents/api/api-basics/extra-merchant-data).
  - `content_type` (string, required) — The content type of the body. It is usually represented as "application/vnd.klarna.internal.emd-v2+json"
- `external_payment_methods[]` (array<object>) — List of external payment methods that will be displayed as part of payment methods in the checkout.
  - `name` (string, required) — The name of the payment provider. (max 255 characters)
  - `fee` (integer) — Minor units. Includes tax.
  - `description` (string) — Short description of the payment method. This is displayed below the selected payment method. (max 500 characters)
  - `countries[]` (array<string>) — If specified, limits the method to the listed countries (alpha 2 codes).
  - `label` (string) — Controls label of buy button

    - continue
    - complete
  - `redirect_url` (string, required) — URL to redirect to. (must be https, min 7, max 2000 characters)
  - `image_url` (string) — URL to an image to display. (must be https, max 2000 characters)
- `external_checkouts[]` (array<object>) — List of external checkouts that will be displayed as part of payment methods in the checkout. Same shape as `external_payment_methods`.
  The image_url is required, and the image size has to be 276x48px
- `shipping_countries[]` (array<string>) — List of allowed shipping countries for this order in ISO-3166 alpha-2 format.

  If specified, the customer will be able to change the shipping country in the checkout and you will be notified through ‘address_update’ callback or the ‘shipping_address_change’ javascript event.

  If not specified then the default value will be the purchase country.

  Example: look at billing_countries example.
- `shipping_options[]` (array<object>) — A list of shipping options available for this order.
  - `id` (string, required) — id
  - `name` (string, required) — Name.
  - `description` (string) — Description.
  - `promo` (string) — Promotion name. To be used if this shipping option is promotional.
  - `price` (integer, required) — Price including tax.
  - `preselected` (boolean) — If true, this option will be preselected when checkout loads. Default: false
  - `tax_amount` (integer, required) — Tax amount.
  - `tax_rate` (integer, required) — Non-negative. In percent, two implicit decimals. I.e 2500 = 25%.
  - `shipping_method` (string) — Shipping method. Possible values:

    - PickUpStore
    - Home
    - BoxReg
    - BoxUnreg
    - PickUpPoint
    - Own
    - Postal
    - DHLPackstation
    - Digital
     If DHLPackstation is selected the correct form will be displayed.
  - `delivery_details` (object)
    - `carrier` (string) — Carrier product name
    - `class` (string) — Type of shipping class
    - `product` (object)
      - `name` (string) — Carrier product name
      - `identifier` (string) — Carrier product identifier
      - `external_id` (string) — The external identifier of the carrier
      - `product_name` (string) — The product or service level name provided by the carrier
      - `meta` (object) — Carrier-specific metadata
        - `key` (string) — Any additional property. The key is free-form; the value has this shape.
    - `timeslot` (object)
      - `id` (string) — Id
      - `start` (string) — Start time
      - `end` (string) — End time
    - `pickup_location` (object)
      - `id` (string) — Id
      - `name` (string) — Name of the location
      - `address` (object)
        - `given_name` (string) — Given name.
        - `family_name` (string) — Family name.
        - `organization_name` (string) — Organization name. Only applicable for orders with customer.type="organization".
        - `email` (string) — E-mail address.
        - `title` (string) — Title.
          Valid values for UK:

          - *Mr*
          - *Ms*
          - *Mrs*
          - *Miss*

          Valid values for DACH:

          - *Herr*
          - *Frau*

          Valid values for NL:

          - *Dhr.*
          - *Mevr.*
        - `street_address` (string) — Street address, first line. (Street name and number)
        - `street_address2` (string) — Street address, second line. (Apartment number, suite, etc.)
        - `street_name` (string) — Street name. Only applicable in DE/AT/NL. Do not combine with street_address. See **streetNumber**.
        - `street_number` (string) — Street number. Only applicable in DE/AT/NL. Do not combine with street_address. See **streetName**.
        - `house_extension` (string) — House extension. Only applicable in NL
        - `postal_code` (string) — Postal/post code.
        - `city` (string) — City.
        - `region` (string) — State or Region.
        - `phone` (string) — Phone number.
        - `country` (string) — ISO 3166 alpha-2. Country.
        - `care_of` (string) — Care of.
  - `tms_reference` (string) — TMS reference. Required to map completed orders to shipments reserved in TMS.
  - `tos_id` (string) — TOS ID. Required to map completed orders to shipments reserved via Ingrid.
  - `selected_addons[]` (array<object>)
    - `type` (string)
    - `price` (integer)
    - `external_id` (string)
    - `user_input` (string)
    - `display_name` (string)
  - `external_method_id` (string) — The external identifier defined on the TMS (Only applicable for Ingrid-Headless)
- `merchant_data` (string) — Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters).
- `gui` (object)
  - `options[]` (array<string>) — An array of options to define the checkout behaviour. Supported options: minimal_confirmation.

    The gui object is an array of options to modify checkout client ui behaviours.

    Examples: ["minimal_confirmation"]
- `merchant_requested` (object)
  - `additional_checkbox` (boolean) — Informs whether the additional_checkbox is checked or not, when applicable.
  - `additional_checkboxes[]` (array<object>) — Informs whether the additional_checkboxes is checked or not, when applicable.
    - `id` (string)
    - `checked` (boolean)
- `selected_shipping_option` (object) Same shape as `shipping_options`.
- `selected_shipping_options[]` (array<object>) Same shape as `shipping_options`.
- `recurring` (boolean) — Indicates whether this purchase will create a token that can be used by the merchant to create recurring purchases. This must be enabled for the merchant to use. Default: false

  Depending on specified country, recurring could be used for the following payment methods: Klarna Pay Later, Direct Debit, Card, Apple Pay, Google Pay.
- `recurring_token` (string) — Token to be used when creating recurring orders.
- `recurring_description` (string) — Description to be added to the recurring order.
- `billing_countries[]` (array<string>) — List of allowed billing countries for this order.
  If specified, the customer will be able to change the billing country in the checkout and you will be notified through ‘country_change’ callback or the ‘billing_address_change’ javascript event.
  If not specified but shipping_countries is specified, will use same values as shipping_countries.
  If not specified and shipping_countries is not specified, then the default value will be the purchase country.

  Example: ["AD", "AE", "AG", "AI", "AL", "AM", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BW", "BY", "BZ", "CA", "CF", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GR", "GS", "GT", "GU", "GY", "HK", "HN", "HR", "HU", "ID", "IE", "IL", "IM", "IN", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SR", "ST", "SV", "SX", "SZ", "TC", "TF", "TG", "TH", "TJ", "TK", "TL", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YT", "ZA", "ZM", "ZW"]"
- `tags[]` (array<string>) — Extra information added to the order.

  Example: ["dangerous_goods", "bulky"]

### Example request

```json
{
  "order_id": "f3392f8b-6116-4073-ab96-e330819e2c07",
  "name": "Women's Fashion",
  "purchase_country": "US",
  "purchase_currency": "USD",
  "locale": "en-US",
  "status": "CHECKOUT_INCOMPLETE",
  "billing_address": {
    "given_name": "John",
    "family_name": "Doe",
    "organization_name": "Acme Corporation",
    "email": "john@doe.com",
    "title": "Mr",
    "street_address": "Lombard St 10",
    "street_address2": "Apt 214",
    "street_name": "Lombard St",
    "street_number": "10",
    "house_extension": "B",
    "postal_code": "90210",
    "city": "Beverly Hills",
    "region": "CA",
    "phone": "333444555",
    "country": "US",
    "care_of": "C/O"
  },
  "shipping_address": {
    "given_name": "John",
    "family_name": "Doe",
    "organization_name": "Acme Corporation",
    "email": "john@doe.com",
    "title": "Mr",
    "street_address": "Lombard St 10",
    "street_address2": "Apt 214",
    "street_name": "Lombard St",
    "street_number": "10",
    "house_extension": "B",
    "postal_code": "90210",
    "city": "Beverly Hills",
    "region": "CA",
    "phone": "333444555",
    "country": "US",
    "care_of": "C/O"
  },
  "order_amount": 50000,
  "order_tax_amount": 4545,
  "order_lines": [
    {
      "type": "physical",
      "reference": "19-402-USA",
      "name": "Red T-Shirt",
      "quantity": 5,
      "subscription": {
        "name": "<string>",
        "interval": "DAY",
        "interval_count": 0
      },
      "quantity_unit": "pcs",
      "unit_price": 10000,
      "tax_rate": 1000,
      "total_amount": 50000,
      "total_discount_amount": 0,
      "total_tax_amount": 4545,
      "merchant_data": "{\"marketplace_seller_info\":[{\"product_category\":\"Women's Fashion\",\"product_name\":\"Women Sweatshirt\"}]}",
      "product_url": "https://www.example.com/products/f2a8d7e34",
      "image_url": "https://www.exampleobjects.com/product-image-1200x1200.jpg",
      "product_identifiers": {
        "brand": "Intel",
        "color": "Blue",
        "category_path": "Electronics Store > Computers & Tablets > Desktops",
        "global_trade_item_number": "735858293167",
        "manufacturer_part_number": "BOXNUC5CPYH",
        "size": "Medium"
      },
      "shipping_attributes": {
        "weight": 1000,
        "dimensions": {
          "height": 100,
          "width": 100,
          "length": 100
        },
        "tags": [
          "<string>"
        ],
        "delivery_id": "<string>"
      }
    }
  ],
  "customer": {
    "type": "person",
    "gender": "male",
    "date_of_birth": "1995-10-20",
    "organization_registration_id": "556737-0431",
    "vat_id": "<string>"
  },
  "merchant_urls": {
    "terms": "https://www.example.com/terms.html",
    "checkout": "https://www.example.com/checkout.html",
    "confirmation": "https://www.example.com/confirmation.html",
    "push": "https://www.example.com/api/push",
    "validation": "https://www.example.com/api/validation",
    "notification": "https://www.example.com/api/pending",
    "cancellation_terms": "https://www.example.com/terms/cancellation.html",
    "shipping_option_update": "https://www.example.com/api/shipment",
    "address_update": "https://www.example.com/api/address",
    "country_change": "https://www.example.com/api/country",
    "upsell": "https://www.example.com/api/upsell",
    "upsell_validation": "https://www.example.com/api/upsell-validation",
    "upsell_notification": "https://www.example.com/api/upsell/{checkout.order.id}"
  },
  "html_snippet": "<div id='klarna-checkout-container'><script>alert('Initializing Kustom Checkout');</script></div>",
  "merchant_reference1": "45aa52f387871e3a210645d4",
  "merchant_reference2": "45aa52f387871e3a210645d4",
  "started_at": "<date-time>",
  "completed_at": "<date-time>",
  "last_modified_at": "<date-time>",
  "options": {
    "require_validate_callback_success": false,
    "acquiring_channel": "<string>",
    "vat_removed": false,
    "tms_configuration_override": {
      "disabled": false
    },
    "allow_separate_shipping_address": false,
    "color_button": "#FF9900",
    "color_button_text": "#FF9900",
    "color_checkbox": "#FF9900",
    "color_checkbox_checkmark": "#FF9900",
    "color_header": "#FF9900",
    "color_link": "#FF9900",
    "color_background": "#FF9900",
    "date_of_birth_mandatory": false,
    "date_of_birth_optional": false,
    "shipping_details": "Delivered within 1-3 working days",
    "title_mandatory": false,
    "additional_checkbox": {
      "text": "Please add me to the newsletter list, read more here \\[link\\](http://www.google.com)",
      "checked": false,
      "required": false
    },
    "national_identification_number_mandatory": false,
    "additional_merchant_terms": "<string>",
    "phone_mandatory": false,
    "radius_border": "5",
    "allowed_customer_types": [
      "<string>"
    ],
    "show_subtotal_detail": false,
    "additional_checkboxes": [
      {
        "text": "Please add me to the newsletter list, read more here \\[link\\](http://www.google.com)",
        "checked": false,
        "required": false,
        "id": "newsletter_opt_in"
      }
    ],
    "verify_national_identification_number": false,
    "auto_capture": false,
    "require_client_validation": false,
    "show_vat_registration_number_field": false,
    "analytics_enabled": false,
    "confirmation_page_upsell": false,
    "subscription_buy_button": false
  },
  "attachment": {
    "body": "{\"hotel_reservation_details\": [{\"pnr\": \"VH67899\",\"hotel_intinerary\": [{\"hotel_name\": \"Hotel ltd.\",\"address\": {\"street_address\": \"Storgatan 3\",\"postal_code\": \"113 35\",\"city\": \"Stockholm\",\"country\": \"Sweden\"},\"start_time\": \"2019-01-31T15:00:00Z\",\"end_time\": \"2019-01-31T15:30:00Z\",\"number_of_rooms\": 2,\"ticket_delivery_method\": \"email\",\"ticket_delivery_recipient\": \"jonas.larlsson@kustom.com\",\"hotel_price\": 23050,\"class\": \"Business\",\"passenger_id\": [1]}],\"passengers\": [{\"id\": 1,\"title\": \"mr\",\"first_name\": \"Adam\",\"last_name\": \"Adamson\"}],\"insurance\": [{\"insurance_company\": \"Insurance Company X\",\"insurance_type\": \"travel\",\"insurance_price\": 0}],\"affiliate_name\": \"TradeMaxi AB\"}],\"air_reservation_details\": [{\"pnr\": \"VH67899\",\"intinerary\": [{\"departure\": \"ARN\",\"departure_city\": \"Stockholm\",\"arrival\": \"NCE\",\"arrival_city\": \"Nice\",\"carrier\": \"SK\",\"segment_price\": 34000,\"departure_date\": \"2019-01-30T15:00:00Z\",\"ticket_delivery_method\": \"email\",\"ticket_delivery_recipient\": \"jonas.larlsson@kustom.com\",\"passenger_id\": [1]}],\"passengers\": [{\"id\": 1,\"title\": \"mr\",\"first_name\": \"Adam\",\"last_name\": \"Adamson\"}],\"insurance\": [{\"insurance_company\": \"Insurance Company X\",\"insurance_type\": \"travel\",\"insurance_price\": 0}],\"affiliate_name\": \"TradeMaxi AB\"}],\"customer_account_info\": [{\"unique_account_identifier\": \"12345\",\"account_registration_date\": \"2016-01-24T15:00:00Z\",\"account_last_modified\": \"2017-01-24T15:00:00Z\"}],\"payment_history_full\": [{\"payment_option\": \"card\",\"number_paid_purchases\": 2,\"total_amount_paid_purchases\": 1234,\"date_of_last_paid_purchase\": \"2018-01-24T15:00:00Z\",\"date_of_first_paid_purchase\": \"2018-01-24T15:00:00Z\"}]}",
    "content_type": "application/vnd.klarna.internal.emd-v2+json"
  },
  "external_payment_methods": [
    {
      "name": "PayhereUs",
      "fee": 0,
      "description": "an American company operating a worldwide online payments system",
      "countries": [
        "<string>"
      ],
      "label": "continue",
      "redirect_url": "https://www.example.com/us/start",
      "image_url": "https://www.exampleobjects.com/product-image-1200x1200.jpg"
    }
  ],
  "external_checkouts": [
    {
      "name": "PayhereUs",
      "fee": 0,
      "description": "an American company operating a worldwide online payments system",
      "countries": [
        "<string>"
      ],
      "label": "continue",
      "redirect_url": "https://www.example.com/us/start",
      "image_url": "https://www.exampleobjects.com/product-image-1200x1200.jpg"
    }
  ],
  "shipping_countries": [
    "<string>"
  ],
  "shipping_options": [
    {
      "id": "express_priority",
      "name": "EXPRESS 1-2 Days",
      "description": "Delivery by 4:30 pm",
      "promo": "Christmas Promotion",
      "price": 0,
      "preselected": false,
      "tax_amount": 0,
      "tax_rate": 0,
      "shipping_method": "PickUpStore",
      "delivery_details": {
        "carrier": "<string>",
        "class": "<string>",
        "product": {
          "name": "<string>",
          "identifier": "<string>",
          "external_id": "<string>",
          "product_name": "Parcel",
          "meta": {
            "key": "<string>"
          }
        },
        "timeslot": {
          "id": "<string>",
          "start": "<string>",
          "end": "<string>"
        },
        "pickup_location": {
          "id": "<string>",
          "name": "<string>",
          "address": {
            "given_name": "John",
            "family_name": "Doe",
            "organization_name": "Acme Corporation",
            "email": "john@doe.com",
            "title": "Mr",
            "street_address": "Lombard St 10",
            "street_address2": "Apt 214",
            "street_name": "Lombard St",
            "street_number": "10",
            "house_extension": "B",
            "postal_code": "90210",
            "city": "Beverly Hills",
            "region": "CA",
            "phone": "333444555",
            "country": "US",
            "care_of": "C/O"
          }
        }
      },
      "tms_reference": "a1b2c3d4-e4f6-g7h8-i9j0-k1l2m3n4o5p6",
      "tos_id": "01K7HJZHY22AAX6PNV5DPXNZQF",
      "selected_addons": [
        {
          "type": "<string>",
          "price": 0,
          "external_id": "<string>",
          "user_input": "<string>",
          "display_name": "<string>"
        }
      ],
      "external_method_id": "dhl-parcelconnect-fr"
    }
  ],
  "merchant_data": "{\"marketplace_seller_info\":[{\"product_category\":\"Women's Fashion\",\"product_name\":\"Women Sweatshirt\"}]}",
  "gui": {
    "options": [
      "<string>"
    ]
  },
  "merchant_requested": {
    "additional_checkbox": false,
    "additional_checkboxes": [
      {
        "id": "<string>",
        "checked": false
      }
    ]
  },
  "selected_shipping_option": {
    "id": "express_priority",
    "name": "EXPRESS 1-2 Days",
    "description": "Delivery by 4:30 pm",
    "promo": "Christmas Promotion",
    "price": 0,
    "preselected": false,
    "tax_amount": 0,
    "tax_rate": 0,
    "shipping_method": "PickUpStore",
    "delivery_details": {
      "carrier": "<string>",
      "class": "<string>",
      "product": {
        "name": "<string>",
        "identifier": "<string>",
        "external_id": "<string>",
        "product_name": "Parcel",
        "meta": {
          "key": "<string>"
        }
      },
      "timeslot": {
        "id": "<string>",
        "start": "<string>",
        "end": "<string>"
      },
      "pickup_location": {
        "id": "<string>",
        "name": "<string>",
        "address": {
          "given_name": "John",
          "family_name": "Doe",
          "organization_name": "Acme Corporation",
          "email": "john@doe.com",
          "title": "Mr",
          "street_address": "Lombard St 10",
          "street_address2": "Apt 214",
          "street_name": "Lombard St",
          "street_number": "10",
          "house_extension": "B",
          "postal_code": "90210",
          "city": "Beverly Hills",
          "region": "CA",
          "phone": "333444555",
          "country": "US",
          "care_of": "C/O"
        }
      }
    },
    "tms_reference": "a1b2c3d4-e4f6-g7h8-i9j0-k1l2m3n4o5p6",
    "tos_id": "01K7HJZHY22AAX6PNV5DPXNZQF",
    "selected_addons": [
      {
        "type": "<string>",
        "price": 0,
        "external_id": "<string>",
        "user_input": "<string>",
        "display_name": "<string>"
      }
    ],
    "external_method_id": "dhl-parcelconnect-fr"
  },
  "selected_shipping_options": [
    {
      "id": "express_priority",
      "name": "EXPRESS 1-2 Days",
      "description": "Delivery by 4:30 pm",
      "promo": "Christmas Promotion",
      "price": 0,
      "preselected": false,
      "tax_amount": 0,
      "tax_rate": 0,
      "shipping_method": "PickUpStore",
      "delivery_details": {
        "carrier": "<string>",
        "class": "<string>",
        "product": {
          "name": "<string>",
          "identifier": "<string>",
          "external_id": "<string>",
          "product_name": "Parcel",
          "meta": {
            "key": "<string>"
          }
        },
        "timeslot": {
          "id": "<string>",
          "start": "<string>",
          "end": "<string>"
        },
        "pickup_location": {
          "id": "<string>",
          "name": "<string>",
          "address": {
            "given_name": "John",
            "family_name": "Doe",
            "organization_name": "Acme Corporation",
            "email": "john@doe.com",
            "title": "Mr",
            "street_address": "Lombard St 10",
            "street_address2": "Apt 214",
            "street_name": "Lombard St",
            "street_number": "10",
            "house_extension": "B",
            "postal_code": "90210",
            "city": "Beverly Hills",
            "region": "CA",
            "phone": "333444555",
            "country": "US",
            "care_of": "C/O"
          }
        }
      },
      "tms_reference": "a1b2c3d4-e4f6-g7h8-i9j0-k1l2m3n4o5p6",
      "tos_id": "01K7HJZHY22AAX6PNV5DPXNZQF",
      "selected_addons": [
        {
          "type": "<string>",
          "price": 0,
          "external_id": "<string>",
          "user_input": "<string>",
          "display_name": "<string>"
        }
      ],
      "external_method_id": "dhl-parcelconnect-fr"
    }
  ],
  "recurring": false,
  "recurring_token": "<string>",
  "recurring_description": "<string>",
  "billing_countries": [
    "<string>"
  ],
  "tags": [
    "<string>"
  ]
}
```

## Responses

### 200

Purchase approved. The consumer will then be redirected as usual to the checkout confirmation page.

### 301

Purchase denied. Checkout will redirect the consumer to the page in Location header value.

### 302

Purchase denied. Checkout will redirect the consumer to the page in Location header value.

### 303

Purchase denied. Checkout will redirect the consumer to the page in Location header value.

### 307

Purchase denied. Checkout will redirect the consumer to the page in Location header value.

### 400

This type of response can be used to show an error text message to the consumer. The response body should include one of the following values in the error_type field: 'address_error', 'unsupported_shipping_address' or 'approval_failed'. An 'error_text' field can also be included in the response (mandatory if error_type is 'address_error' or 'approval_failed'). The error message will be shown to the consumer and he or she will be kept in the Checkout page.

`*/*`

- `error_type` (string, required) — Error type. Possible values: *unsupported_shipping_address*, *address_error* or *approval_failed*
- `error_text` (string, required) — Error text. Required if error_type is *address_error* or *approval_failed*

```json
{
  "error_type": "address_error",
  "error_text": "Ooops, something went wrong..."
}
```
