Next Commerce

Orders Create

Create a new order.

POST
/api/v1/orders/

Authorization

API Authentication
Authorization<token>

Campaign token based authentication.

In: header

Request Body

attribution?
billing_address?
billing_same_as_shipping_address?boolean

Use the shipping address as the billing address

Defaultfalse
currency?|

ISO 4217 currency code (e.g., USD, EUR, GBP), defaults to the campaign currency if not provided

lines*array<>

Array of package IDs

payment_detail*
payment_failed_url?string

Redirect user to this url if payment is unsuccessful

shipping_address?
shipping_method*integer

Shipping method ID for order shipping

success_url*string

Fully qualified url that payment redirect flows will redirect to

use_default_billing_address?boolean

Use the customer's default billing address for this order

Defaultfalse
use_default_shipping_address?boolean

Use the customer's default shipping address for this order

Defaultfalse
user?
vouchers?array<>

Campaign offer codes or store coupon code

Response Body

application/json

curl -X POST "https://campaigns.apps.29next.com/api/v1/orders/" \
  -H "Authorization: " \
  -H "Content-Type: application/json" \
  -d '{
    "lines": [
      {
        "package_id": 0
      }
    ],
    "payment_detail": {
      "payment_method": "apple_pay"
    },
    "shipping_method": 0,
    "success_url": "string"
  }'
{
  "attribution": {
    "affiliate": "string",
    "funnel": "string",
    "gclid": "string",
    "metadata": null,
    "subaffiliate1": "string",
    "subaffiliate2": "string",
    "subaffiliate3": "string",
    "subaffiliate4": "string",
    "subaffiliate5": "string",
    "utm_campaign": "string",
    "utm_content": "string",
    "utm_medium": "string",
    "utm_source": "string",
    "utm_term": "string"
  },
  "billing_address": {
    "country": "string",
    "first_name": "string",
    "last_name": "string",
    "line1": "string",
    "line2": "string",
    "line3": "string",
    "line4": "string",
    "notes": "string",
    "phone_number": "string",
    "postcode": "string",
    "state": "string"
  },
  "currency": "str",
  "discounts": [
    {
      "amount": "string",
      "description": "string",
      "name": "string",
      "offer_id": 0
    }
  ],
  "display_taxes": "string",
  "is_test": true,
  "lines": [
    {
      "id": 0,
      "image": "string",
      "is_upsell": true,
      "price_excl_tax": "string",
      "price_excl_tax_excl_discounts": "string",
      "price_incl_tax": "string",
      "price_incl_tax_excl_discounts": "string",
      "product_id": 0,
      "product_sku": "string",
      "product_title": "string",
      "quantity": 0,
      "variant_id": 0
    }
  ],
  "number": "string",
  "order_status_url": "string",
  "payment_method": "apple_pay",
  "ref_id": "string",
  "shipping_address": {
    "country": "string",
    "first_name": "string",
    "last_name": "string",
    "line1": "string",
    "line2": "string",
    "line3": "string",
    "line4": "string",
    "notes": "string",
    "phone_number": "string",
    "postcode": "string",
    "state": "string"
  },
  "shipping_code": "string",
  "shipping_excl_tax": "string",
  "shipping_incl_tax": "string",
  "shipping_method": "string",
  "shipping_tax": "string",
  "statement_descriptor": "string",
  "supports_post_purchase_upsells": true,
  "total_discounts": "string",
  "total_excl_tax": "string",
  "total_incl_tax": "string",
  "total_tax": "string",
  "user": {
    "accepts_marketing": true,
    "email": "user@example.com",
    "first_name": "string",
    "ip": "string",
    "language": "string",
    "last_name": "string",
    "phone_number": "string",
    "user_agent": "string"
  }
}