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{
"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"
}Create re-shipment
Orders may go missing before they’re delivered to customers for reasons such as incorrect address, theft, labelling issues, or other reasons. This endpoint triggers reshipment in such cases for the existing location.
Note: Shipment ID generated as part of the response is required for subsequent calls such as Acknowledge shipment (POST /shipments//acknowledge) and Get shipment (GET /shipments/).
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{
"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"
}Authorizations
Headers
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.
Body
Details to create shipment
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.
"63ef4360aafa8a7f5247fe48"
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
SHIPMENT_CREATED, SHIPMENT_UPDATED, SHIPMENT_CANCELLED, PICKUP_CREATED, PICKUP_COMPLETED, SHIPMENT_RETURN_PENDING, SHIPMENT_RETURN_RECEIVED, SHIPMENT_PARTIALLY_DELIVERED, SHIPMENT_DELIVERED, SHIPMENT_ERROR "SHIPMENT_CREATED"
Response
OK
Shipment details
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.
"63ef4360aafa8a7f5247fe48"
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.
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
SHIPMENT_CREATED, SHIPMENT_UPDATED, SHIPMENT_CANCELLED, PICKUP_CREATED, PICKUP_COMPLETED, SHIPMENT_DELIVERED, SHIPMENT_RETURN_PENDING, SHIPMENT_RETURN_RECEIVED, SHIPMENT_PARTIALLY_DELIVERED "SHIPMENT_CREATED"
Was this page helpful?
