Skip to main content
POST
/
api
/
v3
/
orders
/
place
Place Order
curl --request POST \
  --url https://api-staging.unbridaled.ai/api/v3/orders/place \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "order_type": "invoice",
  "order_reference": "999917",
  "external_order_id": "777717",
  "line_items": [
    {
      "sku": "UB1E29776FA7",
      "quantity": 1
    }
  ]
}
'
import requests

url = "https://api-staging.unbridaled.ai/api/v3/orders/place"

payload = {
    "order_type": "invoice",
    "order_reference": "999917",
    "external_order_id": "777717",
    "line_items": [
        {
            "sku": "UB1E29776FA7",
            "quantity": 1
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    order_type: 'invoice',
    order_reference: '999917',
    external_order_id: '777717',
    line_items: [{sku: 'UB1E29776FA7', quantity: 1}]
  })
};

fetch('https://api-staging.unbridaled.ai/api/v3/orders/place', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api-staging.unbridaled.ai/api/v3/orders/place",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'order_type' => 'invoice',
    'order_reference' => '999917',
    'external_order_id' => '777717',
    'line_items' => [
        [
                'sku' => 'UB1E29776FA7',
                'quantity' => 1
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-staging.unbridaled.ai/api/v3/orders/place"

	payload := strings.NewReader("{\n  \"order_type\": \"invoice\",\n  \"order_reference\": \"999917\",\n  \"external_order_id\": \"777717\",\n  \"line_items\": [\n    {\n      \"sku\": \"UB1E29776FA7\",\n      \"quantity\": 1\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-staging.unbridaled.ai/api/v3/orders/place")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"order_type\": \"invoice\",\n  \"order_reference\": \"999917\",\n  \"external_order_id\": \"777717\",\n  \"line_items\": [\n    {\n      \"sku\": \"UB1E29776FA7\",\n      \"quantity\": 1\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api-staging.unbridaled.ai/api/v3/orders/place")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"order_type\": \"invoice\",\n  \"order_reference\": \"999917\",\n  \"external_order_id\": \"777717\",\n  \"line_items\": [\n    {\n      \"sku\": \"UB1E29776FA7\",\n      \"quantity\": 1\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "uuid": "973c4c41-ce72-42c5-b184-3f0d8d4bb1af",
  "billing_address": {
    "address_1": "820 Innes Ave.",
    "address_2": "",
    "city": "San Francisco",
    "country_code": "USA",
    "postal_code": "94124",
    "region": "CA"
  },
  "fulfillments": [],
  "line_items": [
    {
      "created_on": "2021-12-15T17:53:29.091914+00:00",
      "description": "",
      "fulfilled_quantity": 0,
      "fulfillment_status": null,
      "name": "Gem UB1E29776FA7",
      "position": 0,
      "price": 1.625,
      "product_type": "gem",
      "quantity": 1,
      "sku": "UB1E29776FA7",
      "uuid": "f1131af3-50ef-42b9-a577-e8cb0a07e1f3"
    }
  ],
  "merchant_uuid": "419c61fa-e674-414a-a1e2-7c5270ed9668",
  "notes": "",
  "order_reference": "9999171",
  "external_order_id": "7777171",
  "order_type": "invoice",
  "ordered_on": "2021-12-15T17:57:09.046284+00:00",
  "payment_status": null,
  "fulfillment_status": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
line_items
object[]
required

Array of LineItem objects

order_type
enum<string>
required

Type of order.

Available options:
invoice,
memo
external_order_id
string
required

The order ID or order number from Shopify or other ecommerce platforms, used to link orders between systems. Must be unique per merchant per order.

order_reference
string

A friendly order reference sent to the end customer by Shopify or other ecommerce platforms. Must be unique per merchant per order.

notes
string

Custom notes on the order

shipping_address_id
string<uuid>

UUID of a merchant shipping address. Defaults to the merchant's default shipping address if not provided. Retrieve available addresses via the List Merchant Addresses endpoint.

Response

200 - application/json

OK

uuid
string
order_type
string
merchant_uuid
string
order_reference
string
order_id
string
fulfillment_status
string | null
payment_status
string | null
line_items
object[]