Skip to content
BolderBolder Developers
Esc
↑↓navigate↵open⌘Jpreview

Create order

Creates a new order in checkout state with the given line items, contact and shipping address. Returns the new order including web checkout and cart links. Requires admin scope.

POST/shops/{shop_id}/orders
Authorization
AuthorizationBearer token (JWT) · headerrequired

OAuth 2.0 Bearer token. Obtain via POST https://auth.onbolder.com/oauth/token.

Scopes:admin
Path parameters
shop_idstringrequired

Shop ID or subdomain

Request body
requiredapplication/json
line_itemsLineItemInput[]
Show properties
Array of LineItemInput
variant_idintegerrequired
unitsintegerrequired

Number of units. Pass -1 to remove this variant from the order.

contactContactInput
Show properties
emailstringrequired

Used to look up an existing contact. Required.

namestring

Required for new contacts

phone_numberstring

Required for new contacts

companystring
addressAddressInput
Show properties
streetstring
street_2string
locality_namestring
region_namestring
country_codestring
postal_codestring
Responses
201

Order created

idinteger
shop_idinteger
codestring
statusstring
Allowed:checkoutpendingclosedshippedinvalid
net_totalinteger

Order subtotal in cents (before shipping/discounts)

totalinteger

Final total in cents

shipping_totalinteger
shipping_descriptionstring
discount_totalinteger
tracking_codestring | null
courier_namestring | null
total_weight_in_gramsinteger
created_onstring<date-time>
updated_onstring<date-time>
pending_onstring<date-time> | null
closed_onstring<date-time> | null
shipped_onstring<date-time> | null
fulfillmentobject
Show properties
fulfillment_methodstring
Allowed:shippingpickup
payment_infoobject
Show properties
typestring
namestring
auth_codestring
transaction_idstring
_linksobject
_embeddedobject
Show properties
contactContactSummary
Show properties
idinteger
namestring
emailstring
phone_numberstring
addressAddress
Show properties
streetstring
street_2string
locality_namestring
region_namestring
country_namestring
country_codestring
postal_codestring | null
lat_longstring

Latitude,longitude pair

line_itemsLineItem[]
Show properties
Array of LineItem
product_idinteger
product_titlestring
unit_priceinteger
unitsinteger
discount_totalinteger
net_totalinteger
totalinteger
variant_idinteger
variant_titlestring
variant_skustring
weight_in_gramsinteger
promotionPromotion
Show properties
namestring
discountinteger
discount_typestring
Allowed:$%
free_shippingboolean
discountsobject[]
422

Validation errors

_classstring[]
_embeddedobject
Show properties
errorsobject[]
Show properties
Array of object
_classstring[]
fieldstring
messagesstring[]
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.onbolder.com/v1/shops/string/orders' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "line_items": [
    {
      "variant_id": 1234,
      "units": 2
    }
  ],
  "contact": {
    "email": "joe@bloggs.com",
    "name": "Joe Bloggs",
    "phone_number": "12322222222"
  },
  "address": {
    "street": "Av. Brasil 20",
    "street_2": "4to piso",
    "locality_name": "Valparaiso",
    "region_name": "Valparaiso",
    "country_code": "CL"
  }
}'
Response
{
  "id": 0,
  "shop_id": 0,
  "code": "string",
  "status": "checkout",
  "net_total": 0,
  "total": 0,
  "shipping_total": 0,
  "shipping_description": "string",
  "discount_total": 0,
  "tracking_code": "string",
  "courier_name": "string",
  "total_weight_in_grams": 0,
  "created_on": "2019-08-24T14:15:22Z",
  "updated_on": "2019-08-24T14:15:22Z",
  "pending_on": "2019-08-24T14:15:22Z",
  "closed_on": "2019-08-24T14:15:22Z",
  "shipped_on": "2019-08-24T14:15:22Z",
  "fulfillment": {
    "fulfillment_method": "shipping"
  },
  "payment_info": {
    "type": "string",
    "name": "string",
    "auth_code": "string",
    "transaction_id": "string"
  },
  "_links": {},
  "_embedded": {
    "contact": {
      "id": 0,
      "name": "string",
      "email": "string",
      "phone_number": "string"
    },
    "address": {
      "street": "string",
      "street_2": "string",
      "locality_name": "string",
      "region_name": "string",
      "country_name": "string",
      "country_code": "string",
      "postal_code": "string",
      "lat_long": "string"
    },
    "line_items": [
      {
        "product_id": 0,
        "product_title": "string",
        "unit_price": 0,
        "units": 0,
        "discount_total": 0,
        "net_total": 0,
        "total": 0,
        "variant_id": 0,
        "variant_title": "string",
        "variant_sku": "string",
        "weight_in_grams": 0
      }
    ],
    "promotion": {
      "name": "string",
      "discount": 0,
      "discount_type": "$",
      "free_shipping": true
    },
    "discounts": [
      {}
    ]
  }
}

Was this page helpful?