Create re-shipment - Fabric
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create re-shipment
cURL
curl --request POST \
--url https://api.fabric.inc/v3/shipments/actions/re-ship \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-channel-id: <x-fabric-channel-id>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '
{
"allocationId": "112345678912340",
"shipmentNumber": "78974156816152",
"attributes": {
"attribute1": "value"
},
"cartons": [\
{\
"cartonNumber": "1",\
"cartonType": "Package",\
"estimatedDeliveryDate": "2023-03-26T07:58:30.996Z",\
"estimatedShipDate": "2023-03-25T07:58:30.996Z",\
"items": [\
{\
"lineItemId": "1",\
"shippedQuantity": 2,\
"attributes": {\
"attribute1": "value"\
},\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"name": "RETURN_FEE",\
"reason": "Return fee",\
"type": "FEE"\
}\
],\
"giftCards": [\
{\
"amount": 50,\
"giftCardNumber": "453456765"\
}\
],\
"itemId": 100023,\
"orderId": "6413e370cb0dc859b6c0dcb0",\
"orderNumber": "309020213",\
"shipmentExternalId": "123k4h123k",\
"orderedQuantity": 2,\
"refundAmount": 10,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"returnQuantity": 1,\
"returnRequestCounter": 1,\
"segment": "segment",\
"sku": "SKU0023",\
"uom": "EA",\
"vendorId": "56"\
}\
],\
"promisedDeliveryDate": "2023-03-26T07:58:30.996Z",\
"shipmentCarrier": "FEDEX",\
"shipmentMethod": "ground",\
"tracking": [\
{\
"event": "picked up",\
"eventId": "627963716b19511e8a3a631b",\
"eventRecordedAt": "2019-09-30T07:58:30.996Z",\
"location": "Reno, NV",\
"notes": {\
"description": "Shipment picked up"\
},\
"shipmentCarrier": "FEDEX"\
}\
],\
"trackingNumber": "1Z999AA10123456784",\
"trackingURL": "https://fedex.com/tracking",\
"weight": "500 gram"\
}\
],
"invoiceId": "63ef4360aafa8a7f5247fe48",
"locationNumber": "WH334",
"locationType": "DC",
"masterTrackingNumber": "TX112345678",
"poNumber": "1125",
"recipients": [\
{\
"email": "support@example.inc",\
"name": {\
"firstName": "Alex",\
"lastName": "Doe",\
"middleName": "E"\
},\
"phone": {\
"number": "123-456-7890",\
"type": "MOBILE"\
}\
}\
],
"reshipmentReasonCode": "Order is missing",
"scratchedItems": [\
{\
"lineItemId": "2",\
"quantity": 1,\
"reasonCode": "ReasonCode23454",\
"attributes": {\
"attribute1": "value"\
},\
"itemId": 100043,\
"orderId": "6413e370cb0dc859b6c0dcb0",\
"orderNumber": 309020213,\
"sku": "SKU00043",\
"shipmentExternalId": "123k4h123k",\
"subReasonCode": "SubReasonCode23242",\
"uom": "EA"\
}\
],
"shipToId": "sg6683620405",
"shipmentId": "627963716b19511e8a3a631b",
"shipmentExternalId": "123k4h123k",
"shippedAt": "2023-04-06T07:58:30.996Z",
"statusCode": "SHIPMENT_CREATED",
"subtype": "COD",
"totalCartons": 2,
"type": "STANDARD",
"vendorId": "56"
}
'
import requests
url = "https://api.fabric.inc/v3/shipments/actions/re-ship"
payload = {
"allocationId": "112345678912340",
"shipmentNumber": "78974156816152",
"attributes": { "attribute1": "value" },
"cartons": [\
{\
"cartonNumber": "1",\
"cartonType": "Package",\
"estimatedDeliveryDate": "2023-03-26T07:58:30.996Z",\
"estimatedShipDate": "2023-03-25T07:58:30.996Z",\
"items": [\
{\
"lineItemId": "1",\
"shippedQuantity": 2,\
"attributes": { "attribute1": "value" },\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"name": "RETURN_FEE",\
"reason": "Return fee",\
"type": "FEE"\
}\
],\
"giftCards": [\
{\
"amount": 50,\
"giftCardNumber": "453456765"\
}\
],\
"itemId": 100023,\
"orderId": "6413e370cb0dc859b6c0dcb0",\
"orderNumber": "309020213",\
"shipmentExternalId": "123k4h123k",\
"orderedQuantity": 2,\
"refundAmount": 10,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"returnQuantity": 1,\
"returnRequestCounter": 1,\
"segment": "segment",\
"sku": "SKU0023",\
"uom": "EA",\
"vendorId": "56"\
}\
],\
"promisedDeliveryDate": "2023-03-26T07:58:30.996Z",\
"shipmentCarrier": "FEDEX",\
"shipmentMethod": "ground",\
"tracking": [\
{\
"event": "picked up",\
"eventId": "627963716b19511e8a3a631b",\
"eventRecordedAt": "2019-09-30T07:58:30.996Z",\
"location": "Reno, NV",\
"notes": { "description": "Shipment picked up" },\
"shipmentCarrier": "FEDEX"\
}\
],\
"trackingNumber": "1Z999AA10123456784",\
"trackingURL": "https://fedex.com/tracking",\
"weight": "500 gram"\
}\
],
"invoiceId": "63ef4360aafa8a7f5247fe48",
"locationNumber": "WH334",
"locationType": "DC",
"masterTrackingNumber": "TX112345678",
"poNumber": "1125",
"recipients": [\
{\
"email": "support@example.inc",\
"name": {\
"firstName": "Alex",\
"lastName": "Doe",\
"middleName": "E"\
},\
"phone": {\
"number": "123-456-7890",\
"type": "MOBILE"\
}\
}\
],
"reshipmentReasonCode": "Order is missing",
"scratchedItems": [\
{\
"lineItemId": "2",\
"quantity": 1,\
"reasonCode": "ReasonCode23454",\
"attributes": { "attribute1": "value" },\
"itemId": 100043,\
"orderId": "6413e370cb0dc859b6c0dcb0",\
"orderNumber": 309020213,\
"sku": "SKU00043",\
"shipmentExternalId": "123k4h123k",\
"subReasonCode": "SubReasonCode23242",\
"uom": "EA"\
}\
],
"shipToId": "sg6683620405",
"shipmentId": "627963716b19511e8a3a631b",
"shipmentExternalId": "123k4h123k",
"shippedAt": "2023-04-06T07:58:30.996Z",
"statusCode": "SHIPMENT_CREATED",
"subtype": "COD",
"totalCartons": 2,
"type": "STANDARD",
"vendorId": "56"
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"x-fabric-channel-id": "<x-fabric-channel-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
'x-fabric-channel-id': '<x-fabric-channel-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
allocationId: '112345678912340',
shipmentNumber: '78974156816152',
attributes: {attribute1: 'value'},
cartons: [\
{\
cartonNumber: '1',\
cartonType: 'Package',\
estimatedDeliveryDate: '2023-03-26T07:58:30.996Z',\
estimatedShipDate: '2023-03-25T07:58:30.996Z',\
items: [\
{\
lineItemId: '1',\
shippedQuantity: 2,\
attributes: {attribute1: 'value'},\
fees: [\
{\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
name: 'RETURN_FEE',\
reason: 'Return fee',\
type: 'FEE'\
}\
],\
giftCards: [{amount: 50, giftCardNumber: '453456765'}],\
itemId: 100023,\
orderId: '6413e370cb0dc859b6c0dcb0',\
orderNumber: '309020213',\
shipmentExternalId: '123k4h123k',\
orderedQuantity: 2,\
refundAmount: 10,\
refundAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
returnQuantity: 1,\
returnRequestCounter: 1,\
segment: 'segment',\
sku: 'SKU0023',\
uom: 'EA',\
vendorId: '56'\
}\
],\
promisedDeliveryDate: '2023-03-26T07:58:30.996Z',\
shipmentCarrier: 'FEDEX',\
shipmentMethod: 'ground',\
tracking: [\
{\
event: 'picked up',\
eventId: '627963716b19511e8a3a631b',\
eventRecordedAt: '2019-09-30T07:58:30.996Z',\
location: 'Reno, NV',\
notes: {description: 'Shipment picked up'},\
shipmentCarrier: 'FEDEX'\
}\
],\
trackingNumber: '1Z999AA10123456784',\
trackingURL: 'https://fedex.com/tracking',\
weight: '500 gram'\
}\
],
invoiceId: '63ef4360aafa8a7f5247fe48',
locationNumber: 'WH334',
locationType: 'DC',
masterTrackingNumber: 'TX112345678',
poNumber: '1125',
recipients: [\
{\
email: 'support@example.inc',\
name: {firstName: 'Alex', lastName: 'Doe', middleName: 'E'},\
phone: {number: '123-456-7890', type: 'MOBILE'}\
}\
],
reshipmentReasonCode: 'Order is missing',
scratchedItems: [\
{\
lineItemId: '2',\
quantity: 1,\
reasonCode: 'ReasonCode23454',\
attributes: {attribute1: 'value'},\
itemId: 100043,\
orderId: '6413e370cb0dc859b6c0dcb0',\
orderNumber: 309020213,\
sku: 'SKU00043',\
shipmentExternalId: '123k4h123k',\
subReasonCode: 'SubReasonCode23242',\
uom: 'EA'\
}\
],
shipToId: 'sg6683620405',
shipmentId: '627963716b19511e8a3a631b',
shipmentExternalId: '123k4h123k',
shippedAt: '2023-04-06T07:58:30.996Z',
statusCode: 'SHIPMENT_CREATED',
subtype: 'COD',
totalCartons: 2,
type: 'STANDARD',
vendorId: '56'
})
};
fetch('https://api.fabric.inc/v3/shipments/actions/re-ship', 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.fabric.inc/v3/shipments/actions/re-ship",\
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([\
'allocationId' => '112345678912340',\
'shipmentNumber' => '78974156816152',\
'attributes' => [\
'attribute1' => 'value'\
],\
'cartons' => [\
[\
'cartonNumber' => '1',\
'cartonType' => 'Package',\
'estimatedDeliveryDate' => '2023-03-26T07:58:30.996Z',\
'estimatedShipDate' => '2023-03-25T07:58:30.996Z',\
'items' => [\
[\
'lineItemId' => '1',\
'shippedQuantity' => 2,\
'attributes' => [\
'attribute1' => 'value'\
],\
'fees' => [\
[\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'name' => 'RETURN_FEE',\
'reason' => 'Return fee',\
'type' => 'FEE'\
]\
],\
'giftCards' => [\
[\
'amount' => 50,\
'giftCardNumber' => '453456765'\
]\
],\
'itemId' => 100023,\
'orderId' => '6413e370cb0dc859b6c0dcb0',\
'orderNumber' => '309020213',\
'shipmentExternalId' => '123k4h123k',\
'orderedQuantity' => 2,\
'refundAmount' => 10,\
'refundAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'returnQuantity' => 1,\
'returnRequestCounter' => 1,\
'segment' => 'segment',\
'sku' => 'SKU0023',\
'uom' => 'EA',\
'vendorId' => '56'\
]\
],\
'promisedDeliveryDate' => '2023-03-26T07:58:30.996Z',\
'shipmentCarrier' => 'FEDEX',\
'shipmentMethod' => 'ground',\
'tracking' => [\
[\
'event' => 'picked up',\
'eventId' => '627963716b19511e8a3a631b',\
'eventRecordedAt' => '2019-09-30T07:58:30.996Z',\
'location' => 'Reno, NV',\
'notes' => [\
'description' => 'Shipment picked up'\
],\
'shipmentCarrier' => 'FEDEX'\
]\
],\
'trackingNumber' => '1Z999AA10123456784',\
'trackingURL' => 'https://fedex.com/tracking',\
'weight' => '500 gram'\
]\
],\
'invoiceId' => '63ef4360aafa8a7f5247fe48',\
'locationNumber' => 'WH334',\
'locationType' => 'DC',\
'masterTrackingNumber' => 'TX112345678',\
'poNumber' => '1125',\
'recipients' => [\
[\
'email' => 'support@example.inc',\
'name' => [\
'firstName' => 'Alex',\
'lastName' => 'Doe',\
'middleName' => 'E'\
],\
'phone' => [\
'number' => '123-456-7890',\
'type' => 'MOBILE'\
]\
]\
],\
'reshipmentReasonCode' => 'Order is missing',\
'scratchedItems' => [\
[\
'lineItemId' => '2',\
'quantity' => 1,\
'reasonCode' => 'ReasonCode23454',\
'attributes' => [\
'attribute1' => 'value'\
],\
'itemId' => 100043,\
'orderId' => '6413e370cb0dc859b6c0dcb0',\
'orderNumber' => 309020213,\
'sku' => 'SKU00043',\
'shipmentExternalId' => '123k4h123k',\
'subReasonCode' => 'SubReasonCode23242',\
'uom' => 'EA'\
]\
],\
'shipToId' => 'sg6683620405',\
'shipmentId' => '627963716b19511e8a3a631b',\
'shipmentExternalId' => '123k4h123k',\
'shippedAt' => '2023-04-06T07:58:30.996Z',\
'statusCode' => 'SHIPMENT_CREATED',\
'subtype' => 'COD',\
'totalCartons' => 2,\
'type' => 'STANDARD',\
'vendorId' => '56'\
]),\
CURLOPT_HTTPHEADER => [\
"Authorization: Bearer <token>",\
"Content-Type: application/json",\
"x-fabric-channel-id: <x-fabric-channel-id>",\
"x-fabric-tenant-id: <x-fabric-tenant-id>"\
],\
]);
$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.fabric.inc/v3/shipments/actions/re-ship"
payload := strings.NewReader("{\n \"allocationId\": \"112345678912340\",\n \"shipmentNumber\": \"78974156816152\",\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"cartons\": [\n {\n \"cartonNumber\": \"1\",\n \"cartonType\": \"Package\",\n \"estimatedDeliveryDate\": \"2023-03-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2023-03-25T07:58:30.996Z\",\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"shippedQuantity\": 2,\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"giftCards\": [\n {\n \"amount\": 50,\n \"giftCardNumber\": \"453456765\"\n }\n ],\n \"itemId\": 100023,\n \"orderId\": \"6413e370cb0dc859b6c0dcb0\",\n \"orderNumber\": \"309020213\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"orderedQuantity\": 2,\n \"refundAmount\": 10,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"returnQuantity\": 1,\n \"returnRequestCounter\": 1,\n \"segment\": \"segment\",\n \"sku\": \"SKU0023\",\n \"uom\": \"EA\",\n \"vendorId\": \"56\"\n }\n ],\n \"promisedDeliveryDate\": \"2023-03-26T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"shipmentMethod\": \"ground\",\n \"tracking\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"eventRecordedAt\": \"2019-09-30T07:58:30.996Z\",\n \"location\": \"Reno, NV\",\n \"notes\": {\n \"description\": \"Shipment picked up\"\n },\n \"shipmentCarrier\": \"FEDEX\"\n }\n ],\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"weight\": \"500 gram\"\n }\n ],\n \"invoiceId\": \"63ef4360aafa8a7f5247fe48\",\n \"locationNumber\": \"WH334\",\n \"locationType\": \"DC\",\n \"masterTrackingNumber\": \"TX112345678\",\n \"poNumber\": \"1125\",\n \"recipients\": [\n {\n \"email\": \"support@example.inc\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"reshipmentReasonCode\": \"Order is missing\",\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"quantity\": 1,\n \"reasonCode\": \"ReasonCode23454\",\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"itemId\": 100043,\n \"orderId\": \"6413e370cb0dc859b6c0dcb0\",\n \"orderNumber\": 309020213,\n \"sku\": \"SKU00043\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"subReasonCode\": \"SubReasonCode23242\",\n \"uom\": \"EA\"\n }\n ],\n \"shipToId\": \"sg6683620405\",\n \"shipmentId\": \"627963716b19511e8a3a631b\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"shippedAt\": \"2023-04-06T07:58:30.996Z\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"subtype\": \"COD\",\n \"totalCartons\": 2,\n \"type\": \"STANDARD\",\n \"vendorId\": \"56\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
req.Header.Add("x-fabric-channel-id", "<x-fabric-channel-id>")
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.fabric.inc/v3/shipments/actions/re-ship")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("x-fabric-channel-id", "<x-fabric-channel-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allocationId\": \"112345678912340\",\n \"shipmentNumber\": \"78974156816152\",\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"cartons\": [\n {\n \"cartonNumber\": \"1\",\n \"cartonType\": \"Package\",\n \"estimatedDeliveryDate\": \"2023-03-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2023-03-25T07:58:30.996Z\",\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"shippedQuantity\": 2,\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"giftCards\": [\n {\n \"amount\": 50,\n \"giftCardNumber\": \"453456765\"\n }\n ],\n \"itemId\": 100023,\n \"orderId\": \"6413e370cb0dc859b6c0dcb0\",\n \"orderNumber\": \"309020213\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"orderedQuantity\": 2,\n \"refundAmount\": 10,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"returnQuantity\": 1,\n \"returnRequestCounter\": 1,\n \"segment\": \"segment\",\n \"sku\": \"SKU0023\",\n \"uom\": \"EA\",\n \"vendorId\": \"56\"\n }\n ],\n \"promisedDeliveryDate\": \"2023-03-26T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"shipmentMethod\": \"ground\",\n \"tracking\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"eventRecordedAt\": \"2019-09-30T07:58:30.996Z\",\n \"location\": \"Reno, NV\",\n \"notes\": {\n \"description\": \"Shipment picked up\"\n },\n \"shipmentCarrier\": \"FEDEX\"\n }\n ],\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"weight\": \"500 gram\"\n }\n ],\n \"invoiceId\": \"63ef4360aafa8a7f5247fe48\",\n \"locationNumber\": \"WH334\",\n \"locationType\": \"DC\",\n \"masterTrackingNumber\": \"TX112345678\",\n \"poNumber\": \"1125\",\n \"recipients\": [\n {\n \"email\": \"support@example.inc\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"reshipmentReasonCode\": \"Order is missing\",\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"quantity\": 1,\n \"reasonCode\": \"ReasonCode23454\",\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"itemId\": 100043,\n \"orderId\": \"6413e370cb0dc859b6c0dcb0\",\n \"orderNumber\": 309020213,\n \"sku\": \"SKU00043\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"subReasonCode\": \"SubReasonCode23242\",\n \"uom\": \"EA\"\n }\n ],\n \"shipToId\": \"sg6683620405\",\n \"shipmentId\": \"627963716b19511e8a3a631b\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"shippedAt\": \"2023-04-06T07:58:30.996Z\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"subtype\": \"COD\",\n \"totalCartons\": 2,\n \"type\": \"STANDARD\",\n \"vendorId\": \"56\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/shipments/actions/re-ship")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["x-fabric-channel-id"] = '<x-fabric-channel-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allocationId\": \"112345678912340\",\n \"shipmentNumber\": \"78974156816152\",\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"cartons\": [\n {\n \"cartonNumber\": \"1\",\n \"cartonType\": \"Package\",\n \"estimatedDeliveryDate\": \"2023-03-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2023-03-25T07:58:30.996Z\",\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"shippedQuantity\": 2,\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"giftCards\": [\n {\n \"amount\": 50,\n \"giftCardNumber\": \"453456765\"\n }\n ],\n \"itemId\": 100023,\n \"orderId\": \"6413e370cb0dc859b6c0dcb0\",\n \"orderNumber\": \"309020213\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"orderedQuantity\": 2,\n \"refundAmount\": 10,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"returnQuantity\": 1,\n \"returnRequestCounter\": 1,\n \"segment\": \"segment\",\n \"sku\": \"SKU0023\",\n \"uom\": \"EA\",\n \"vendorId\": \"56\"\n }\n ],\n \"promisedDeliveryDate\": \"2023-03-26T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"shipmentMethod\": \"ground\",\n \"tracking\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"eventRecordedAt\": \"2019-09-30T07:58:30.996Z\",\n \"location\": \"Reno, NV\",\n \"notes\": {\n \"description\": \"Shipment picked up\"\n },\n \"shipmentCarrier\": \"FEDEX\"\n }\n ],\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"weight\": \"500 gram\"\n }\n ],\n \"invoiceId\": \"63ef4360aafa8a7f5247fe48\",\n \"locationNumber\": \"WH334\",\n \"locationType\": \"DC\",\n \"masterTrackingNumber\": \"TX112345678\",\n \"poNumber\": \"1125\",\n \"recipients\": [\n {\n \"email\": \"support@example.inc\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"reshipmentReasonCode\": \"Order is missing\",\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"quantity\": 1,\n \"reasonCode\": \"ReasonCode23454\",\n \"attributes\": {\n \"attribute1\": \"value\"\n },\n \"itemId\": 100043,\n \"orderId\": \"6413e370cb0dc859b6c0dcb0\",\n \"orderNumber\": 309020213,\n \"sku\": \"SKU00043\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"subReasonCode\": \"SubReasonCode23242\",\n \"uom\": \"EA\"\n }\n ],\n \"shipToId\": \"sg6683620405\",\n \"shipmentId\": \"627963716b19511e8a3a631b\",\n \"shipmentExternalId\": \"123k4h123k\",\n \"shippedAt\": \"2023-04-06T07:58:30.996Z\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"subtype\": \"COD\",\n \"totalCartons\": 2,\n \"type\": \"STANDARD\",\n \"vendorId\": \"56\"\n}"
response = http.request(request)
puts response.read_body
200
400
401
500
{
"version": 2,
"allocationId": "6413e3d3fd03a35efccb426e",
"auditLogs": [\
{\
"auditId": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",\
"auditType": "CANCEL",\
"auditedAt": "2023-03-12T09:24:54.804Z",\
"employeeId": "6227",\
"lineItemId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",\
"note": "Note",\
"reasonCode": "Scratched item",\
"source": "POS",\
"subReasonCode": "Scratched item",\
"updatedFields": [\
{\
"fieldName": "UOM",\
"fieldOriginalValue": "PK"\
}\
]\
}\
],
"cartons": [\
{\
"cartonNumber": "1",\
"cartonType": "Package",\
"estimatedDeliveryDate": "2023-04-26T07:58:30.996Z",\
"estimatedShipmentDate": "2023-03-25T07:58:30.996Z",\
"items": [\
{\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"name": "RETURN_FEE",\
"reason": "Return fee",\
"type": "FEE"\
}\
],\
"giftCards": [\
{\
"amount": 50,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"giftCardActivatedAt": "2023-04-26T07:58:30.996Z",\
"giftCardActivationRequestedAt": "2023-03-26T07:58:30.996Z",\
"giftCardNumber": "453456765",\
"giftCardStatus": "ACTIVE"\
}\
],\
"itemId": 100023,\
"lineItemId": "1",\
"orderId": "6413e370cb0dc859b6c0dcb0",\
"orderNumber": "309020213",\
"orderedQuantity": 2,\
"refundAmount": 10,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"returnQuantity": 1,\
"segment": "segment",\
"shipmentLineItemId": "607f1f77bcf86cd799439011",\
"shippedQuantity": 2,\
"sku": "SKU0023",\
"uom": "EA",\
"vendorId": "vend12346667"\
}\
],\
"promisedDeliveryDate": "2023-03-26T07:58:30.996Z",\
"shipmentCarrier": "FEDEX",\
"shipmentMethod": "ground",\
"tracking": [\
{\
"event": "picked up",\
"eventId": "627963716b19511e8a3a631b",\
"eventRecordedAt": "2019-09-30T07:58:30.996Z",\
"location": "Reno, NV",\
"notes": {\
"description": "Shipment picked up"\
},\
"shipmentCarrier": "FEDEX"\
}\
],\
"trackingNumber": "1Z999AA10123456784",\
"trackingURL": "https://example.com/tracking",\
"weight": "500 grams"\
}\
],
"createdAt": "2023-04-06T07:58:30.996Z",
"invoiceId": "63ef4360aafa8a7f5247fe48",
"locationNumber": "WH334",
"locationType": "DC",
"masterTrackingNumber": "TX112345678",
"orderNumbers": [\
"309020213, 459020213"\
],
"poNumber": "1125",
"recipients": [\
{\
"email": "support@example.inc",\
"name": {\
"firstName": "Alex",\
"lastName": "Doe",\
"middleName": "E"\
},\
"phone": {\
"number": "123-456-7890",\
"type": "MOBILE"\
}\
}\
],
"reshipmentReasonCode": "Order is missing",
"scratchedItems": [\
{\
"reasonCode": "ReasonCode23454",\
"itemId": 100043,\
"lineItemId": "2",\
"orderId": "6413e370cb0dc859b6c0dcb0",\
"quantity": 1,\
"sku": "SKU00043",\
"subReasonCode": "SubReasonCode23242",\
"uom": "EA"\
}\
],
"shipToAddress": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"countryCode": "US",
"latitude": 47.6205,
"longitude": -122.3493,
"postalCode": "98121",
"region": "WA",
"type": "Home",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
}
},
"shipToId": "1",
"shipmentId": "627963716b19511e8a3a631b",
"shipmentNumber": "78974156816152",
"shipmentExternalId": "123k4h123k",
"shippedAt": "2023-04-06T07:58:30.996Z",
"statusCode": "SHIPMENT_CREATED",
"subtype": "COD",
"totalCartons": 2,
"type": "STANDARD",
"updatedAt": "2023-04-06T07:58:30.996Z",
"vendorId": "56"
}
{
"errors": [\
{\
"message": "Invalid request",\
"type": "CLIENT_ERROR"\
}\
],
"message": "Bad request",
"type": "CLIENT_ERROR"
}
{
"message": "Unauthorized request",
"type": "CLIENT_ERROR"
}
{
"message": "Internal server error",
"type": "SERVER_ERROR"
}
POST
/
shipments
/
actions
/
re-ship
Try it
Create re-shipment
cURL
import requests
url = "https://api.fabric.inc/v3/shipments/actions/re-ship"
response = requests.post(url, json=payload, headers=headers)
print(response.text)
<?php
$curl = curl_init();
$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.fabric.inc/v3/shipments/actions/re-ship"
req, _ := http.NewRequest("POST", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/shipments/actions/re-ship")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
response = http.request(request)
puts response.read_body
200
400
401
500
{
"errors": [\
{\
"message": "Invalid request",\
"type": "CLIENT_ERROR"\
}\
],
"message": "Bad request",
"type": "CLIENT_ERROR"
}
{
"message": "Unauthorized request",
"type": "CLIENT_ERROR"
}
{
"message": "Internal server error",
"type": "SERVER_ERROR"
}
Authorizations
Authorization
string
header
required
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
x-fabric-tenant-id
string
required
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
x-fabric-channel-id
string
required
x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
x-fabric-request-id
string
Unique request ID
Body
application/json
Details to create shipment
allocationId
string
required
Allocation ID for this shipment, generated by the fabric Allocation service through Create allocation (internal) endpoint, which occurs prior to Shipment Creation. This is mandatory to create a new shipment.
Example:
"112345678912340"
shipmentNumber
string
required
Merchant-defined shipment identifier
Example:
"78974156816152"
attributes
object
Merchant-defined custom attributes. This is a placeholder for addition info (in key: value pairs)
Example:
{ "attribute1": "value" }
cartons
object[]
Carton details
Show child attributes
invoiceId
string
Invoice ID generated from fabric Invoice service during shipment creation. Note: Invoices are only created for Shipments where merchants have payment Capture at Shipment feature enabled. The value will be “Null” if merchants don't have “Capture at Shipment” feature enabled.
Example:
"63ef4360aafa8a7f5247fe48"
locationNumber
string
Unique value to identify ship-from location. This must be the locationNumber stored in the fabric Location service.
Example:
"WH334"
locationType
string
Location type, such as distribution center (DC) or warehouse. This must be the type stored in the fabric Location service.
Example:
"DC"
masterTrackingNumber
string
Master tracking number for all cartons in the shipment
Example:
"TX112345678"
poNumber
string
Merchant-defined purchase order number
Example:
"1125"
recipients
object[]
Recipient details
Show child attributes
reshipmentReasonCode
string
Reshipment reason code
Example:
"Order is missing"
scratchedItems
object[]
Scratched items
Show child attributes
shipToAddress
object
Address details
Show child attributes
shipToId
string
Ship-to ID generated in the response of Create Shipping endpoint of Shipping service
Example:
"sg6683620405"
shipmentId
string
Shipment's autogenerated unique id
Example:
"627963716b19511e8a3a631b"
shipmentExternalId
string
Unique shipment identifier defined by the merchant. This value can be used to track or reconcile shipments in external systems and serves as a reference between fabric and the merchant's order management or fulfillment system.
Example:
"123k4h123k"
shippedAt
string
Order shipment time (UTC)
Example:
"2023-04-06T07:58:30.996Z"
statusCode
enum
Current shipment status (fabric-defined codes). For standard shipments, the initial status would be SHIPMENT_CREATED. For pickup shipment, the initial status would be PICKUP_CREATED and once the customer picks up, the status changes to PICKUP_COMPLETED
Available options:
SHIPMENT_CREATED,
SHIPMENT_UPDATED,
SHIPMENT_CANCELLED,
PICKUP_CREATED,
PICKUP_COMPLETED,
SHIPMENT_RETURN_PENDING,
SHIPMENT_RETURN_RECEIVED,
SHIPMENT_PARTIALLY_DELIVERED,
SHIPMENT_DELIVERED,
SHIPMENT_ERROR
Example:
"SHIPMENT_CREATED"
subtype
string
Shipment subtype. Free-form text to add another layer of classification, if required.
Example:
"COD"
totalCartons
integer
Total number of cartons in the given shipment.
Example:
2
type
enum
Shipment types
Available options:
STANDARD,
RESHIP,
RETURN,
SCRATCH,
PENDING_RETURN,
PICKUP,
TRANSFER
Example:
"STANDARD"
vendorId
string
Vendor ID. Applicable in dropshipping scenarios to indicate the vendor responsible for the given item.
Example:
"56"
Response
200
application/json
OK
Shipment details
version
integer
required
The current version of the shipment document. This integer indicates the number of times the shipment has been updated by any operation.
Example:
2
allocationId
string
System-generated allocation ID (UUID) from the Create allocation endpoint of fabric Allocation service. It refers to the given shipment. Note: Allocation occurs prior to Shipment Creation. allocationId is mandatory to create a Shipment.
Example:
"6413e3d3fd03a35efccb426e"
auditLogs
object[]
Audit log details
Show child attributes
cartons
object[]
Carton details
Show child attributes
createdAt
string
Shipment creation time (UTC)
Example:
"2023-04-06T07:58:30.996Z"
invoiceId
string
Example:
"63ef4360aafa8a7f5247fe48"
locationNumber
string
Unique value to identify ship-from location. This must be the locationNumber stored in the fabric Location service.
Example:
"WH334"
locationType
string
Location type, such as distribution center (DC) or warehouse
Example:
"DC"
masterTrackingNumber
string
Master tracking number for all cartons in the shipment
Example:
"TX112345678"
orderNumbers
string[]
List of order numbers associated with a shipment. Note: Currently, a shipment can be associated with only one order. In the future, this property will support a scenario where a customer places a second order for the same product immediately after their first order. Multiple order numbers can be linked to one shipment in such cases.
poNumber
string
Merchant-defined purchase order number
Example:
"1125"
recipients
object[]
Recipient details
Show child attributes
reshipmentReasonCode
string
The reshipment reason code.
Example:
"Order is missing"
scratchedItems
object[]
Details of scratched items
Show child attributes
shipToAddress
object
Address details
Show child attributes
shipToId
string
Ship-to ID generated in the response of Create shipping endpoint of Shipping service
Example:
"1"
shipmentId
string
System-generated shipment ID (UUID)
Example:
"627963716b19511e8a3a631b"
shipmentNumber
string
Merchant-defined unique shipment identifier. Note: It can be optionally generated by fabric by using resource generator feature in the Configuration service
Example:
"78974156816152"
shipmentExternalId
string
Example:
"123k4h123k"
shippedAt
string
Order shipment time (UTC)
Example:
"2023-04-06T07:58:30.996Z"
statusCode
enum
Current shipment status (fabric-defined codes). Note: For standard shipments, the status would be SHIPMENT_CREATED. For pickup shipment, the initial status would be PICKUP_CREATED and once the customer picks up, the status changes to PICKUP_COMPLETED
Available options:
SHIPMENT_CREATED,
SHIPMENT_UPDATED,
SHIPMENT_CANCELLED,
PICKUP_CREATED,
PICKUP_COMPLETED,
SHIPMENT_DELIVERED,
SHIPMENT_RETURN_PENDING,
SHIPMENT_RETURN_RECEIVED,
SHIPMENT_PARTIALLY_DELIVERED
Example:
"SHIPMENT_CREATED"
subtype
string
Shipment subtype, for another layer of classification. There are no pre-defined values; the possible value is Cash On Delivery (COD)
Example:
"COD"
totalCartons
integer
Total number of cartons in the given shipment. There can be only one carton per trackingNumber.
Example:
2
type
enum
Shipment types
Available options:
STANDARD,
RESHIP,
RETURN,
SCRATCH,
PENDING_RETURN,
PICKUP,
TRANSFER
Example:
"STANDARD"
updatedAt
string
Time of last update to shipment (UTC)
Example:
"2023-04-06T07:58:30.996Z"
vendorId
string
Vendor ID. Applicable in dropshipping scenarios to indicate the vendor responsible for the given item.
Example:
"56"
Was this page helpful?
YesNo
Find shipments Update shipment tracking
Ctrl+I
Assistant
Responses are generated using AI and may contain mistakes.