Submit a new order
What this endpoint does
This endpoint creates a final order in OpenBorder’s Order Management System (OMS) once your customer has selected their shipping option and agreed to the calculated landed cost. This call ensures the order is registered in OpenBorder’s OMS so we can:
- Record the exact duties & taxes to be remitted to authorities
- Guarantee the correct shipping rate is linked to the shipment
- Generate accurate billing and settlement for your international shipments
curl --request POST \
--url https://api.openborder.com/api/direct/v1/orders \
--header 'Content-Type: application/json' \
--header 'x-openborder-direct-api-key: <x-openborder-direct-api-key>' \
--data '
{
"source": "<string>",
"source_reference": 123,
"landedcost_request_id": "<string>",
"source_created_at": "<string>",
"source_updated_at": "<string>",
"total": 123,
"shipments": [
{
"tax_transaction_id": "<string>",
"shipment_id": "<string>"
}
],
"custom_properties": {}
}
'import requests
url = "https://api.openborder.com/api/direct/v1/orders"
payload = {
"source": "<string>",
"source_reference": 123,
"landedcost_request_id": "<string>",
"source_created_at": "<string>",
"source_updated_at": "<string>",
"total": 123,
"shipments": [
{
"tax_transaction_id": "<string>",
"shipment_id": "<string>"
}
],
"custom_properties": {}
}
headers = {
"x-openborder-direct-api-key": "<x-openborder-direct-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-openborder-direct-api-key': '<x-openborder-direct-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: '<string>',
source_reference: 123,
landedcost_request_id: '<string>',
source_created_at: '<string>',
source_updated_at: '<string>',
total: 123,
shipments: [{tax_transaction_id: '<string>', shipment_id: '<string>'}],
custom_properties: {}
})
};
fetch('https://api.openborder.com/api/direct/v1/orders', 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.openborder.com/api/direct/v1/orders",
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([
'source' => '<string>',
'source_reference' => 123,
'landedcost_request_id' => '<string>',
'source_created_at' => '<string>',
'source_updated_at' => '<string>',
'total' => 123,
'shipments' => [
[
'tax_transaction_id' => '<string>',
'shipment_id' => '<string>'
]
],
'custom_properties' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-openborder-direct-api-key: <x-openborder-direct-api-key>"
],
]);
$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.openborder.com/api/direct/v1/orders"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"source_reference\": 123,\n \"landedcost_request_id\": \"<string>\",\n \"source_created_at\": \"<string>\",\n \"source_updated_at\": \"<string>\",\n \"total\": 123,\n \"shipments\": [\n {\n \"tax_transaction_id\": \"<string>\",\n \"shipment_id\": \"<string>\"\n }\n ],\n \"custom_properties\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-openborder-direct-api-key", "<x-openborder-direct-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.openborder.com/api/direct/v1/orders")
.header("x-openborder-direct-api-key", "<x-openborder-direct-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"source_reference\": 123,\n \"landedcost_request_id\": \"<string>\",\n \"source_created_at\": \"<string>\",\n \"source_updated_at\": \"<string>\",\n \"total\": 123,\n \"shipments\": [\n {\n \"tax_transaction_id\": \"<string>\",\n \"shipment_id\": \"<string>\"\n }\n ],\n \"custom_properties\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openborder.com/api/direct/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-openborder-direct-api-key"] = '<x-openborder-direct-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"source_reference\": 123,\n \"landedcost_request_id\": \"<string>\",\n \"source_created_at\": \"<string>\",\n \"source_updated_at\": \"<string>\",\n \"total\": 123,\n \"shipments\": [\n {\n \"tax_transaction_id\": \"<string>\",\n \"shipment_id\": \"<string>\"\n }\n ],\n \"custom_properties\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": [
{
"field": "ship_from",
"error": "Name is required"
}
]
}Headers
OpenBorder merchant API token
Body
Source system from which the order originated.
Reference ID from the source system. This is the unique identifier to reference the order on subsequent calls and cannot be updated.
Unique ID for this tax calculation request provided when calculating landed cost.
Timestamp in ISO format when the order was created in the source system.
Timestamp in ISO format when the order was last updated in the source system.
Total amount of the order including all charges, taxes, duties, discounts and refund in major currency units (e.g., dollars). Up to two decimal places are allowed.
Shipments on the order. Each must include a tax_request_id from the tax calculation step.
Show child attributes
Show child attributes
Billing address for the order.
Show child attributes
Show child attributes
Optional custom metadata or structured properties. Object max. size is 4 KB.
Response
Order successfully created. No content returned.
curl --request POST \
--url https://api.openborder.com/api/direct/v1/orders \
--header 'Content-Type: application/json' \
--header 'x-openborder-direct-api-key: <x-openborder-direct-api-key>' \
--data '
{
"source": "<string>",
"source_reference": 123,
"landedcost_request_id": "<string>",
"source_created_at": "<string>",
"source_updated_at": "<string>",
"total": 123,
"shipments": [
{
"tax_transaction_id": "<string>",
"shipment_id": "<string>"
}
],
"custom_properties": {}
}
'import requests
url = "https://api.openborder.com/api/direct/v1/orders"
payload = {
"source": "<string>",
"source_reference": 123,
"landedcost_request_id": "<string>",
"source_created_at": "<string>",
"source_updated_at": "<string>",
"total": 123,
"shipments": [
{
"tax_transaction_id": "<string>",
"shipment_id": "<string>"
}
],
"custom_properties": {}
}
headers = {
"x-openborder-direct-api-key": "<x-openborder-direct-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-openborder-direct-api-key': '<x-openborder-direct-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: '<string>',
source_reference: 123,
landedcost_request_id: '<string>',
source_created_at: '<string>',
source_updated_at: '<string>',
total: 123,
shipments: [{tax_transaction_id: '<string>', shipment_id: '<string>'}],
custom_properties: {}
})
};
fetch('https://api.openborder.com/api/direct/v1/orders', 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.openborder.com/api/direct/v1/orders",
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([
'source' => '<string>',
'source_reference' => 123,
'landedcost_request_id' => '<string>',
'source_created_at' => '<string>',
'source_updated_at' => '<string>',
'total' => 123,
'shipments' => [
[
'tax_transaction_id' => '<string>',
'shipment_id' => '<string>'
]
],
'custom_properties' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-openborder-direct-api-key: <x-openborder-direct-api-key>"
],
]);
$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.openborder.com/api/direct/v1/orders"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"source_reference\": 123,\n \"landedcost_request_id\": \"<string>\",\n \"source_created_at\": \"<string>\",\n \"source_updated_at\": \"<string>\",\n \"total\": 123,\n \"shipments\": [\n {\n \"tax_transaction_id\": \"<string>\",\n \"shipment_id\": \"<string>\"\n }\n ],\n \"custom_properties\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-openborder-direct-api-key", "<x-openborder-direct-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.openborder.com/api/direct/v1/orders")
.header("x-openborder-direct-api-key", "<x-openborder-direct-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"source_reference\": 123,\n \"landedcost_request_id\": \"<string>\",\n \"source_created_at\": \"<string>\",\n \"source_updated_at\": \"<string>\",\n \"total\": 123,\n \"shipments\": [\n {\n \"tax_transaction_id\": \"<string>\",\n \"shipment_id\": \"<string>\"\n }\n ],\n \"custom_properties\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openborder.com/api/direct/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-openborder-direct-api-key"] = '<x-openborder-direct-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"source_reference\": 123,\n \"landedcost_request_id\": \"<string>\",\n \"source_created_at\": \"<string>\",\n \"source_updated_at\": \"<string>\",\n \"total\": 123,\n \"shipments\": [\n {\n \"tax_transaction_id\": \"<string>\",\n \"shipment_id\": \"<string>\"\n }\n ],\n \"custom_properties\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": [
{
"field": "ship_from",
"error": "Name is required"
}
]
}