Add aliases to existing orders
curl --request POST \
--url https://api.northbeam.io/v2/orders/aliases \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'Data-Client-ID: <api-key>' \
--data '
{
"aliases": [
{
"order_id": "<string>",
"type": "shopify_checkout_token",
"id": "abc-xyz-123"
}
]
}
'const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'Data-Client-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
aliases: [{order_id: '<string>', type: 'shopify_checkout_token', id: 'abc-xyz-123'}]
})
};
fetch('https://api.northbeam.io/v2/orders/aliases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.northbeam.io/v2/orders/aliases"
payload = { "aliases": [
{
"order_id": "<string>",
"type": "shopify_checkout_token",
"id": "abc-xyz-123"
}
] }
headers = {
"Authorization": "<api-key>",
"Data-Client-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.northbeam.io/v2/orders/aliases",
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([
'aliases' => [
[
'order_id' => '<string>',
'type' => 'shopify_checkout_token',
'id' => 'abc-xyz-123'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"Data-Client-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.northbeam.io/v2/orders/aliases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Data-Client-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"aliases\": [\n {\n \"order_id\": \"<string>\",\n \"type\": \"shopify_checkout_token\",\n \"id\": \"abc-xyz-123\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.northbeam.io/v2/orders/aliases"
payload := strings.NewReader("{\n \"aliases\": [\n {\n \"order_id\": \"<string>\",\n \"type\": \"shopify_checkout_token\",\n \"id\": \"abc-xyz-123\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Data-Client-ID", "<api-key>")
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.northbeam.io/v2/orders/aliases")
.header("Authorization", "<api-key>")
.header("Data-Client-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"aliases\": [\n {\n \"order_id\": \"<string>\",\n \"type\": \"shopify_checkout_token\",\n \"id\": \"abc-xyz-123\"\n }\n ]\n}")
.asString();Orders API
Add aliases to existing orders
Additively attach alternate order IDs to existing orders. Aliases that already exist are silently ignored. Orders must already exist.
POST
/
orders
/
aliases
Add aliases to existing orders
curl --request POST \
--url https://api.northbeam.io/v2/orders/aliases \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'Data-Client-ID: <api-key>' \
--data '
{
"aliases": [
{
"order_id": "<string>",
"type": "shopify_checkout_token",
"id": "abc-xyz-123"
}
]
}
'const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'Data-Client-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
aliases: [{order_id: '<string>', type: 'shopify_checkout_token', id: 'abc-xyz-123'}]
})
};
fetch('https://api.northbeam.io/v2/orders/aliases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.northbeam.io/v2/orders/aliases"
payload = { "aliases": [
{
"order_id": "<string>",
"type": "shopify_checkout_token",
"id": "abc-xyz-123"
}
] }
headers = {
"Authorization": "<api-key>",
"Data-Client-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.northbeam.io/v2/orders/aliases",
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([
'aliases' => [
[
'order_id' => '<string>',
'type' => 'shopify_checkout_token',
'id' => 'abc-xyz-123'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"Data-Client-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.northbeam.io/v2/orders/aliases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Data-Client-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"aliases\": [\n {\n \"order_id\": \"<string>\",\n \"type\": \"shopify_checkout_token\",\n \"id\": \"abc-xyz-123\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.northbeam.io/v2/orders/aliases"
payload := strings.NewReader("{\n \"aliases\": [\n {\n \"order_id\": \"<string>\",\n \"type\": \"shopify_checkout_token\",\n \"id\": \"abc-xyz-123\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Data-Client-ID", "<api-key>")
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.northbeam.io/v2/orders/aliases")
.header("Authorization", "<api-key>")
.header("Data-Client-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"aliases\": [\n {\n \"order_id\": \"<string>\",\n \"type\": \"shopify_checkout_token\",\n \"id\": \"abc-xyz-123\"\n }\n ]\n}")
.asString();Additively attach alternate order IDs to existing orders. Aliases that already
exist are silently ignored. Orders must already exist.
Headers
| Header | Description |
|---|---|
Authorization required | Your Northbeam API key |
Data-Client-ID required | Your Northbeam client ID |
Content-Type required | application/json |
Body
| Field | Type | Description |
|---|---|---|
aliases required | object[] | Maximum array length: 2500 |
Field Type Description Example order_id requiredstring The order_id to attach this alias to Minimum string length: 1type requiredstring Alias type identifier Minimum string length: 1”shopify_checkout_token”id requiredstring The alternate order ID value Minimum string length: 1”abc-xyz-123” |
Responses
| Status | Description |
|---|---|
200 | Aliases accepted |
400 | Validation error |
404 | One or more order_ids not found |