Skip to main content
POST
/
orders
Create an order
curl --request POST \
  --url https://api.bitbybit.studio/customer/open/v1/orders \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "lineItems": [
    {
      "productVariantId": "<string>",
      "quantity": 2
    }
  ],
  "shippingAddress": {
    "firstName": "<string>",
    "lastName": "<string>",
    "phone": "<string>",
    "address1": "<string>",
    "city": "<string>",
    "province": "<string>",
    "zip": "<string>",
    "address2": "<string>",
    "country": "<string>"
  },
  "customerId": "<string>",
  "notes": "<string>",
  "tags": [
    "<string>"
  ]
}
'
{
  "data": {
    "id": "<string>",
    "orderId": "<string>",
    "orderNumber": "<string>",
    "status": "active",
    "fulfillmentStatus": "unfulfilled",
    "financialStatus": "pending",
    "total": 123,
    "currency": "<string>",
    "notes": "<string>",
    "customer": {
      "id": "<string>",
      "firstName": "<string>",
      "lastName": "<string>",
      "email": "<string>",
      "phoneNumber": "<string>"
    },
    "lineItems": [
      {
        "id": "<string>",
        "quantity": 123,
        "price": 123,
        "title": "<string>",
        "productVariant": {
          "id": "<string>",
          "key": "<string>",
          "price": 123,
          "compareAtPrice": 123,
          "inventorySku": "<string>",
          "media": "<string>"
        }
      }
    ],
    "shippingAddress": {
      "id": "<string>",
      "firstName": "<string>",
      "lastName": "<string>",
      "phone": "<string>",
      "address1": "<string>",
      "address2": "<string>",
      "city": "<string>",
      "province": "<string>",
      "country": "<string>",
      "zip": "<string>"
    },
    "tags": [
      "<string>"
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

x-api-key
string
header
required

API key for authentication. Create one in Settings > Developer.

Body

application/json
lineItems
object[]
required
Minimum array length: 1
shippingAddress
object
required
customerId
string

ID of an existing customer

customer
object

Create or find a customer by phone/email

notes
string
tags
string[]

Response

Order created

data
object