Update an order
What this endpoint does
Use this endpoint to update a previously submitted order. Order will be matched by the source_reference field.
Supported updates may include order and shipment status changes, shipment product changes (for example refunds, product changes or new shipments added), or corrections to customer addresses.
curl --request PUT \
--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_reference": 123,
"source_updated_at": "<string>",
"order_discount": 123,
"shipments": [
{
"shipment_id": "<string>",
"shipping_rate_id": "<string>",
"shipping_rate": 123,
"fulfillments": [
{
"tracking_number": "<string>",
"location": "<string>",
"carrier": "<string>",
"shipped_at": "<string>",
"items": [
{
"source_line_id": "<string>",
"source_product_id": 123,
"source_variant_id": 123,
"quantity": 123,
"hs_code": "<string>"
}
]
}
],
"refunded_amount": 123,
"items": [
{
"source_line_id": "<string>",
"hs_code": "<string>",
"quantity": 123,
"unit_price": 123,
"unit_discount": 123,
"sku": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"description": "<string>",
"origin_country_code": "<string>",
"category": "<string>",
"requires_shipping": true,
"source_product_id": 123,
"source_variant_id": 123,
"refunded_quantity": 123
}
]
}
],
"custom_properties": {}
}
'import requests
url = "https://api.openborder.com/api/direct/v1/orders"
payload = {
"source_reference": 123,
"source_updated_at": "<string>",
"order_discount": 123,
"shipments": [
{
"shipment_id": "<string>",
"shipping_rate_id": "<string>",
"shipping_rate": 123,
"fulfillments": [
{
"tracking_number": "<string>",
"location": "<string>",
"carrier": "<string>",
"shipped_at": "<string>",
"items": [
{
"source_line_id": "<string>",
"source_product_id": 123,
"source_variant_id": 123,
"quantity": 123,
"hs_code": "<string>"
}
]
}
],
"refunded_amount": 123,
"items": [
{
"source_line_id": "<string>",
"hs_code": "<string>",
"quantity": 123,
"unit_price": 123,
"unit_discount": 123,
"sku": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"description": "<string>",
"origin_country_code": "<string>",
"category": "<string>",
"requires_shipping": True,
"source_product_id": 123,
"source_variant_id": 123,
"refunded_quantity": 123
}
]
}
],
"custom_properties": {}
}
headers = {
"x-openborder-direct-api-key": "<x-openborder-direct-api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-openborder-direct-api-key': '<x-openborder-direct-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source_reference: 123,
source_updated_at: '<string>',
order_discount: 123,
shipments: [
{
shipment_id: '<string>',
shipping_rate_id: '<string>',
shipping_rate: 123,
fulfillments: [
{
tracking_number: '<string>',
location: '<string>',
carrier: '<string>',
shipped_at: '<string>',
items: [
{
source_line_id: '<string>',
source_product_id: 123,
source_variant_id: 123,
quantity: 123,
hs_code: '<string>'
}
]
}
],
refunded_amount: 123,
items: [
{
source_line_id: '<string>',
hs_code: '<string>',
quantity: 123,
unit_price: 123,
unit_discount: 123,
sku: '<string>',
product_name: '<string>',
variant_name: '<string>',
description: '<string>',
origin_country_code: '<string>',
category: '<string>',
requires_shipping: true,
source_product_id: 123,
source_variant_id: 123,
refunded_quantity: 123
}
]
}
],
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'source_reference' => 123,
'source_updated_at' => '<string>',
'order_discount' => 123,
'shipments' => [
[
'shipment_id' => '<string>',
'shipping_rate_id' => '<string>',
'shipping_rate' => 123,
'fulfillments' => [
[
'tracking_number' => '<string>',
'location' => '<string>',
'carrier' => '<string>',
'shipped_at' => '<string>',
'items' => [
[
'source_line_id' => '<string>',
'source_product_id' => 123,
'source_variant_id' => 123,
'quantity' => 123,
'hs_code' => '<string>'
]
]
]
],
'refunded_amount' => 123,
'items' => [
[
'source_line_id' => '<string>',
'hs_code' => '<string>',
'quantity' => 123,
'unit_price' => 123,
'unit_discount' => 123,
'sku' => '<string>',
'product_name' => '<string>',
'variant_name' => '<string>',
'description' => '<string>',
'origin_country_code' => '<string>',
'category' => '<string>',
'requires_shipping' => true,
'source_product_id' => 123,
'source_variant_id' => 123,
'refunded_quantity' => 123
]
]
]
],
'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_reference\": 123,\n \"source_updated_at\": \"<string>\",\n \"order_discount\": 123,\n \"shipments\": [\n {\n \"shipment_id\": \"<string>\",\n \"shipping_rate_id\": \"<string>\",\n \"shipping_rate\": 123,\n \"fulfillments\": [\n {\n \"tracking_number\": \"<string>\",\n \"location\": \"<string>\",\n \"carrier\": \"<string>\",\n \"shipped_at\": \"<string>\",\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"quantity\": 123,\n \"hs_code\": \"<string>\"\n }\n ]\n }\n ],\n \"refunded_amount\": 123,\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"unit_discount\": 123,\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"variant_name\": \"<string>\",\n \"description\": \"<string>\",\n \"origin_country_code\": \"<string>\",\n \"category\": \"<string>\",\n \"requires_shipping\": true,\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"refunded_quantity\": 123\n }\n ]\n }\n ],\n \"custom_properties\": {}\n}")
req, _ := http.NewRequest("PUT", 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.put("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_reference\": 123,\n \"source_updated_at\": \"<string>\",\n \"order_discount\": 123,\n \"shipments\": [\n {\n \"shipment_id\": \"<string>\",\n \"shipping_rate_id\": \"<string>\",\n \"shipping_rate\": 123,\n \"fulfillments\": [\n {\n \"tracking_number\": \"<string>\",\n \"location\": \"<string>\",\n \"carrier\": \"<string>\",\n \"shipped_at\": \"<string>\",\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"quantity\": 123,\n \"hs_code\": \"<string>\"\n }\n ]\n }\n ],\n \"refunded_amount\": 123,\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"unit_discount\": 123,\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"variant_name\": \"<string>\",\n \"description\": \"<string>\",\n \"origin_country_code\": \"<string>\",\n \"category\": \"<string>\",\n \"requires_shipping\": true,\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"refunded_quantity\": 123\n }\n ]\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::Put.new(url)
request["x-openborder-direct-api-key"] = '<x-openborder-direct-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_reference\": 123,\n \"source_updated_at\": \"<string>\",\n \"order_discount\": 123,\n \"shipments\": [\n {\n \"shipment_id\": \"<string>\",\n \"shipping_rate_id\": \"<string>\",\n \"shipping_rate\": 123,\n \"fulfillments\": [\n {\n \"tracking_number\": \"<string>\",\n \"location\": \"<string>\",\n \"carrier\": \"<string>\",\n \"shipped_at\": \"<string>\",\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"quantity\": 123,\n \"hs_code\": \"<string>\"\n }\n ]\n }\n ],\n \"refunded_amount\": 123,\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"unit_discount\": 123,\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"variant_name\": \"<string>\",\n \"description\": \"<string>\",\n \"origin_country_code\": \"<string>\",\n \"category\": \"<string>\",\n \"requires_shipping\": true,\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"refunded_quantity\": 123\n }\n ]\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
Reference ID from the source system. This is the unique identifier to reference the order on subsequent calls and cannot be updated.
Timestamp in ISO format when the order was last updated in the source system.
Address to which the order is shipped.
Show child attributes
Show child attributes
Billing address for the order.
Show child attributes
Show child attributes
Total order-level discount in major currency units (e.g., 10.00 means $10 off). Discount is split proportionally across products for duties/taxes.
A shipment groups the items sent from a specific origin warehouse to the order's destination address.
While a shipment originates from one location, it can be fulfilled in multiple batches (fulfillments), each potentially having a different tracking number, ship date, and carrier.
To add a new shipment, provide a new shipment object with a new shipment_id
Show child attributes
Show child attributes
Optional custom metadata or structured properties. Object max. size is 4 KB.
Response
Order successfully updated. No content returned.
curl --request PUT \
--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_reference": 123,
"source_updated_at": "<string>",
"order_discount": 123,
"shipments": [
{
"shipment_id": "<string>",
"shipping_rate_id": "<string>",
"shipping_rate": 123,
"fulfillments": [
{
"tracking_number": "<string>",
"location": "<string>",
"carrier": "<string>",
"shipped_at": "<string>",
"items": [
{
"source_line_id": "<string>",
"source_product_id": 123,
"source_variant_id": 123,
"quantity": 123,
"hs_code": "<string>"
}
]
}
],
"refunded_amount": 123,
"items": [
{
"source_line_id": "<string>",
"hs_code": "<string>",
"quantity": 123,
"unit_price": 123,
"unit_discount": 123,
"sku": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"description": "<string>",
"origin_country_code": "<string>",
"category": "<string>",
"requires_shipping": true,
"source_product_id": 123,
"source_variant_id": 123,
"refunded_quantity": 123
}
]
}
],
"custom_properties": {}
}
'import requests
url = "https://api.openborder.com/api/direct/v1/orders"
payload = {
"source_reference": 123,
"source_updated_at": "<string>",
"order_discount": 123,
"shipments": [
{
"shipment_id": "<string>",
"shipping_rate_id": "<string>",
"shipping_rate": 123,
"fulfillments": [
{
"tracking_number": "<string>",
"location": "<string>",
"carrier": "<string>",
"shipped_at": "<string>",
"items": [
{
"source_line_id": "<string>",
"source_product_id": 123,
"source_variant_id": 123,
"quantity": 123,
"hs_code": "<string>"
}
]
}
],
"refunded_amount": 123,
"items": [
{
"source_line_id": "<string>",
"hs_code": "<string>",
"quantity": 123,
"unit_price": 123,
"unit_discount": 123,
"sku": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"description": "<string>",
"origin_country_code": "<string>",
"category": "<string>",
"requires_shipping": True,
"source_product_id": 123,
"source_variant_id": 123,
"refunded_quantity": 123
}
]
}
],
"custom_properties": {}
}
headers = {
"x-openborder-direct-api-key": "<x-openborder-direct-api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-openborder-direct-api-key': '<x-openborder-direct-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source_reference: 123,
source_updated_at: '<string>',
order_discount: 123,
shipments: [
{
shipment_id: '<string>',
shipping_rate_id: '<string>',
shipping_rate: 123,
fulfillments: [
{
tracking_number: '<string>',
location: '<string>',
carrier: '<string>',
shipped_at: '<string>',
items: [
{
source_line_id: '<string>',
source_product_id: 123,
source_variant_id: 123,
quantity: 123,
hs_code: '<string>'
}
]
}
],
refunded_amount: 123,
items: [
{
source_line_id: '<string>',
hs_code: '<string>',
quantity: 123,
unit_price: 123,
unit_discount: 123,
sku: '<string>',
product_name: '<string>',
variant_name: '<string>',
description: '<string>',
origin_country_code: '<string>',
category: '<string>',
requires_shipping: true,
source_product_id: 123,
source_variant_id: 123,
refunded_quantity: 123
}
]
}
],
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'source_reference' => 123,
'source_updated_at' => '<string>',
'order_discount' => 123,
'shipments' => [
[
'shipment_id' => '<string>',
'shipping_rate_id' => '<string>',
'shipping_rate' => 123,
'fulfillments' => [
[
'tracking_number' => '<string>',
'location' => '<string>',
'carrier' => '<string>',
'shipped_at' => '<string>',
'items' => [
[
'source_line_id' => '<string>',
'source_product_id' => 123,
'source_variant_id' => 123,
'quantity' => 123,
'hs_code' => '<string>'
]
]
]
],
'refunded_amount' => 123,
'items' => [
[
'source_line_id' => '<string>',
'hs_code' => '<string>',
'quantity' => 123,
'unit_price' => 123,
'unit_discount' => 123,
'sku' => '<string>',
'product_name' => '<string>',
'variant_name' => '<string>',
'description' => '<string>',
'origin_country_code' => '<string>',
'category' => '<string>',
'requires_shipping' => true,
'source_product_id' => 123,
'source_variant_id' => 123,
'refunded_quantity' => 123
]
]
]
],
'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_reference\": 123,\n \"source_updated_at\": \"<string>\",\n \"order_discount\": 123,\n \"shipments\": [\n {\n \"shipment_id\": \"<string>\",\n \"shipping_rate_id\": \"<string>\",\n \"shipping_rate\": 123,\n \"fulfillments\": [\n {\n \"tracking_number\": \"<string>\",\n \"location\": \"<string>\",\n \"carrier\": \"<string>\",\n \"shipped_at\": \"<string>\",\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"quantity\": 123,\n \"hs_code\": \"<string>\"\n }\n ]\n }\n ],\n \"refunded_amount\": 123,\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"unit_discount\": 123,\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"variant_name\": \"<string>\",\n \"description\": \"<string>\",\n \"origin_country_code\": \"<string>\",\n \"category\": \"<string>\",\n \"requires_shipping\": true,\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"refunded_quantity\": 123\n }\n ]\n }\n ],\n \"custom_properties\": {}\n}")
req, _ := http.NewRequest("PUT", 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.put("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_reference\": 123,\n \"source_updated_at\": \"<string>\",\n \"order_discount\": 123,\n \"shipments\": [\n {\n \"shipment_id\": \"<string>\",\n \"shipping_rate_id\": \"<string>\",\n \"shipping_rate\": 123,\n \"fulfillments\": [\n {\n \"tracking_number\": \"<string>\",\n \"location\": \"<string>\",\n \"carrier\": \"<string>\",\n \"shipped_at\": \"<string>\",\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"quantity\": 123,\n \"hs_code\": \"<string>\"\n }\n ]\n }\n ],\n \"refunded_amount\": 123,\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"unit_discount\": 123,\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"variant_name\": \"<string>\",\n \"description\": \"<string>\",\n \"origin_country_code\": \"<string>\",\n \"category\": \"<string>\",\n \"requires_shipping\": true,\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"refunded_quantity\": 123\n }\n ]\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::Put.new(url)
request["x-openborder-direct-api-key"] = '<x-openborder-direct-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_reference\": 123,\n \"source_updated_at\": \"<string>\",\n \"order_discount\": 123,\n \"shipments\": [\n {\n \"shipment_id\": \"<string>\",\n \"shipping_rate_id\": \"<string>\",\n \"shipping_rate\": 123,\n \"fulfillments\": [\n {\n \"tracking_number\": \"<string>\",\n \"location\": \"<string>\",\n \"carrier\": \"<string>\",\n \"shipped_at\": \"<string>\",\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"quantity\": 123,\n \"hs_code\": \"<string>\"\n }\n ]\n }\n ],\n \"refunded_amount\": 123,\n \"items\": [\n {\n \"source_line_id\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"unit_discount\": 123,\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"variant_name\": \"<string>\",\n \"description\": \"<string>\",\n \"origin_country_code\": \"<string>\",\n \"category\": \"<string>\",\n \"requires_shipping\": true,\n \"source_product_id\": 123,\n \"source_variant_id\": 123,\n \"refunded_quantity\": 123\n }\n ]\n }\n ],\n \"custom_properties\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": [
{
"field": "ship_from",
"error": "Name is required"
}
]
}