curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"warehouse_id": "<string>",
"shipment_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"free_quantity": 123,
"selling_price": 123
}
],
"shipping_option": "manual",
"shipping_provider_id": "<string>",
"total_weight": 123,
"expected_delivery_date": "2023-12-25",
"tracking_link": "<string>",
"manual_shipping_charges": 123,
"fulfillment_type": "delivery",
"boxes": [
{
"box_name": "<string>",
"box_length": 123,
"box_width": 123,
"box_height": 123,
"box_weight": 123,
"items_count": 123,
"box_count": 123
}
],
"reason": "<string>"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement"
payload = {
"warehouse_id": "<string>",
"shipment_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"free_quantity": 123,
"selling_price": 123
}
],
"shipping_option": "manual",
"shipping_provider_id": "<string>",
"total_weight": 123,
"expected_delivery_date": "2023-12-25",
"tracking_link": "<string>",
"manual_shipping_charges": 123,
"fulfillment_type": "delivery",
"boxes": [
{
"box_name": "<string>",
"box_length": 123,
"box_width": 123,
"box_height": 123,
"box_weight": 123,
"items_count": 123,
"box_count": 123
}
],
"reason": "<string>"
}
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({
warehouse_id: '<string>',
shipment_items: [
{
product_id: '<string>',
variant_id: '<string>',
quantity: 123,
free_quantity: 123,
selling_price: 123
}
],
shipping_option: 'manual',
shipping_provider_id: '<string>',
total_weight: 123,
expected_delivery_date: '2023-12-25',
tracking_link: '<string>',
manual_shipping_charges: 123,
fulfillment_type: 'delivery',
boxes: [
{
box_name: '<string>',
box_length: 123,
box_width: 123,
box_height: 123,
box_weight: 123,
items_count: 123,
box_count: 123
}
],
reason: '<string>'
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement', 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://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement",
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([
'warehouse_id' => '<string>',
'shipment_items' => [
[
'product_id' => '<string>',
'variant_id' => '<string>',
'quantity' => 123,
'free_quantity' => 123,
'selling_price' => 123
]
],
'shipping_option' => 'manual',
'shipping_provider_id' => '<string>',
'total_weight' => 123,
'expected_delivery_date' => '2023-12-25',
'tracking_link' => '<string>',
'manual_shipping_charges' => 123,
'fulfillment_type' => 'delivery',
'boxes' => [
[
'box_name' => '<string>',
'box_length' => 123,
'box_width' => 123,
'box_height' => 123,
'box_weight' => 123,
'items_count' => 123,
'box_count' => 123
]
],
'reason' => '<string>'
]),
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://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement"
payload := strings.NewReader("{\n \"warehouse_id\": \"<string>\",\n \"shipment_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"free_quantity\": 123,\n \"selling_price\": 123\n }\n ],\n \"shipping_option\": \"manual\",\n \"shipping_provider_id\": \"<string>\",\n \"total_weight\": 123,\n \"expected_delivery_date\": \"2023-12-25\",\n \"tracking_link\": \"<string>\",\n \"manual_shipping_charges\": 123,\n \"fulfillment_type\": \"delivery\",\n \"boxes\": [\n {\n \"box_name\": \"<string>\",\n \"box_length\": 123,\n \"box_width\": 123,\n \"box_height\": 123,\n \"box_weight\": 123,\n \"items_count\": 123,\n \"box_count\": 123\n }\n ],\n \"reason\": \"<string>\"\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://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"warehouse_id\": \"<string>\",\n \"shipment_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"free_quantity\": 123,\n \"selling_price\": 123\n }\n ],\n \"shipping_option\": \"manual\",\n \"shipping_provider_id\": \"<string>\",\n \"total_weight\": 123,\n \"expected_delivery_date\": \"2023-12-25\",\n \"tracking_link\": \"<string>\",\n \"manual_shipping_charges\": 123,\n \"fulfillment_type\": \"delivery\",\n \"boxes\": [\n {\n \"box_name\": \"<string>\",\n \"box_length\": 123,\n \"box_width\": 123,\n \"box_height\": 123,\n \"box_weight\": 123,\n \"items_count\": 123,\n \"box_count\": 123\n }\n ],\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement")
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 \"warehouse_id\": \"<string>\",\n \"shipment_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"free_quantity\": 123,\n \"selling_price\": 123\n }\n ],\n \"shipping_option\": \"manual\",\n \"shipping_provider_id\": \"<string>\",\n \"total_weight\": 123,\n \"expected_delivery_date\": \"2023-12-25\",\n \"tracking_link\": \"<string>\",\n \"manual_shipping_charges\": 123,\n \"fulfillment_type\": \"delivery\",\n \"boxes\": [\n {\n \"box_name\": \"<string>\",\n \"box_length\": 123,\n \"box_width\": 123,\n \"box_height\": 123,\n \"box_weight\": 123,\n \"items_count\": 123,\n \"box_count\": 123\n }\n ],\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true
}Create a replacement shipment
Creates a replacement shipment against an existing shipment. Use the manual payload to dispatch outside an integrated carrier, or the auto payload to fulfill through an integrated carrier with system-managed packing and rates.
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"warehouse_id": "<string>",
"shipment_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"free_quantity": 123,
"selling_price": 123
}
],
"shipping_option": "manual",
"shipping_provider_id": "<string>",
"total_weight": 123,
"expected_delivery_date": "2023-12-25",
"tracking_link": "<string>",
"manual_shipping_charges": 123,
"fulfillment_type": "delivery",
"boxes": [
{
"box_name": "<string>",
"box_length": 123,
"box_width": 123,
"box_height": 123,
"box_weight": 123,
"items_count": 123,
"box_count": 123
}
],
"reason": "<string>"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement"
payload = {
"warehouse_id": "<string>",
"shipment_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"free_quantity": 123,
"selling_price": 123
}
],
"shipping_option": "manual",
"shipping_provider_id": "<string>",
"total_weight": 123,
"expected_delivery_date": "2023-12-25",
"tracking_link": "<string>",
"manual_shipping_charges": 123,
"fulfillment_type": "delivery",
"boxes": [
{
"box_name": "<string>",
"box_length": 123,
"box_width": 123,
"box_height": 123,
"box_weight": 123,
"items_count": 123,
"box_count": 123
}
],
"reason": "<string>"
}
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({
warehouse_id: '<string>',
shipment_items: [
{
product_id: '<string>',
variant_id: '<string>',
quantity: 123,
free_quantity: 123,
selling_price: 123
}
],
shipping_option: 'manual',
shipping_provider_id: '<string>',
total_weight: 123,
expected_delivery_date: '2023-12-25',
tracking_link: '<string>',
manual_shipping_charges: 123,
fulfillment_type: 'delivery',
boxes: [
{
box_name: '<string>',
box_length: 123,
box_width: 123,
box_height: 123,
box_weight: 123,
items_count: 123,
box_count: 123
}
],
reason: '<string>'
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement', 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://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement",
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([
'warehouse_id' => '<string>',
'shipment_items' => [
[
'product_id' => '<string>',
'variant_id' => '<string>',
'quantity' => 123,
'free_quantity' => 123,
'selling_price' => 123
]
],
'shipping_option' => 'manual',
'shipping_provider_id' => '<string>',
'total_weight' => 123,
'expected_delivery_date' => '2023-12-25',
'tracking_link' => '<string>',
'manual_shipping_charges' => 123,
'fulfillment_type' => 'delivery',
'boxes' => [
[
'box_name' => '<string>',
'box_length' => 123,
'box_width' => 123,
'box_height' => 123,
'box_weight' => 123,
'items_count' => 123,
'box_count' => 123
]
],
'reason' => '<string>'
]),
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://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement"
payload := strings.NewReader("{\n \"warehouse_id\": \"<string>\",\n \"shipment_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"free_quantity\": 123,\n \"selling_price\": 123\n }\n ],\n \"shipping_option\": \"manual\",\n \"shipping_provider_id\": \"<string>\",\n \"total_weight\": 123,\n \"expected_delivery_date\": \"2023-12-25\",\n \"tracking_link\": \"<string>\",\n \"manual_shipping_charges\": 123,\n \"fulfillment_type\": \"delivery\",\n \"boxes\": [\n {\n \"box_name\": \"<string>\",\n \"box_length\": 123,\n \"box_width\": 123,\n \"box_height\": 123,\n \"box_weight\": 123,\n \"items_count\": 123,\n \"box_count\": 123\n }\n ],\n \"reason\": \"<string>\"\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://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"warehouse_id\": \"<string>\",\n \"shipment_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"free_quantity\": 123,\n \"selling_price\": 123\n }\n ],\n \"shipping_option\": \"manual\",\n \"shipping_provider_id\": \"<string>\",\n \"total_weight\": 123,\n \"expected_delivery_date\": \"2023-12-25\",\n \"tracking_link\": \"<string>\",\n \"manual_shipping_charges\": 123,\n \"fulfillment_type\": \"delivery\",\n \"boxes\": [\n {\n \"box_name\": \"<string>\",\n \"box_length\": 123,\n \"box_width\": 123,\n \"box_height\": 123,\n \"box_weight\": 123,\n \"items_count\": 123,\n \"box_count\": 123\n }\n ],\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/shipping/shipments/{reference_number}/replacement")
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 \"warehouse_id\": \"<string>\",\n \"shipment_items\": [\n {\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"quantity\": 123,\n \"free_quantity\": 123,\n \"selling_price\": 123\n }\n ],\n \"shipping_option\": \"manual\",\n \"shipping_provider_id\": \"<string>\",\n \"total_weight\": 123,\n \"expected_delivery_date\": \"2023-12-25\",\n \"tracking_link\": \"<string>\",\n \"manual_shipping_charges\": 123,\n \"fulfillment_type\": \"delivery\",\n \"boxes\": [\n {\n \"box_name\": \"<string>\",\n \"box_length\": 123,\n \"box_width\": 123,\n \"box_height\": 123,\n \"box_weight\": 123,\n \"items_count\": 123,\n \"box_count\": 123\n }\n ],\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Reference number of the original shipment being replaced.
Body
- CreateReplacementShipmentWithManualMethod
- CreateReplacementShipmentWithAutoMethod
- CreateReplacementShipmentForCollectInStore
Replacement shipment payload when fulfilling through a manual courier (no carrier integration).
The warehouse from which the replacement items will be shipped.
Show child attributes
Show child attributes
Set to manual to dispatch the shipment outside of an integrated carrier.
manual The manual shipping provider used to fulfill the replacement.
The packing option for the replacement shipment.
manual, auto Total shipment weight in kilograms, used for rate calculation by the carrier.
The expected delivery date communicated to the customer.
Optional tracking URL shared with the customer.
Shipping charges incurred for the manual dispatch.
Set to delivery when the replacement is shipped to the customer.
"delivery"The boxes for the replacement shipment.
Show child attributes
Show child attributes
The reason for the replacement shipment.
Was this page helpful?