curl --request POST \
--url https://prod01.oms.fabric.inc/api/v2/shipment/reship \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"shipmentNum": "78974156816152",
"allocationId": "112345678912340",
"invoiceId": "5674156816152",
"poNumber": "1125",
"vendorId": "56",
"statusCode": "SHIPMENT_CREATED",
"type": "STANDARD",
"reshipmentReasonCode": "Order went missing",
"shipDate": "2022-06-06T07:58:30.996Z",
"locationNum": "132412",
"locationType": "DC",
"totalCartons": 2,
"masterTrackingNumber": "TX112345678",
"shipToId": "1",
"shipToAddress": {
"addressLine1": "888 Broadway",
"addressLine2": "505 suite",
"addressLine3": "<string>",
"addressLine4": "<string>",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "1003",
"type": "home",
"latitude": 134.13413,
"longitude": 757.0435
},
"recipient": [
{
"name": {
"first": "John",
"middle": "<string>",
"last": "Doe"
},
"email": "support@abc.inc",
"phone": {
"number": 10612345678,
"type": "MOBILE"
}
}
],
"cartons": [
{
"cartonNum": "1",
"cartonType": "Package",
"promisedDeliveryDate": "2022-05-26T07:58:30.996Z",
"estimatedShipDate": "2022-05-25T07:58:30.996Z",
"estimatedDeliveryDate": "2022-05-26T07:58:30.996Z",
"shipmentMethod": "ground",
"shipmentCarrier": "FEDEX",
"weight": "500 gram",
"trackingNumber": "1Z999AA10123456784",
"trackingURL": "https://fedex.com/tracking",
"trackingDetails": [
{
"event": "picked up",
"eventId": "627963716b19511e8a3a631b",
"timestamp": "2019-09-30T07:58:30.996Z",
"shipmentCarrier": "FEDEX",
"location": "Reno, NV",
"notes": {}
}
],
"items": [
{
"lineItemId": "1",
"itemId": "100023",
"sku": "SKU0023",
"orderId": "317736896",
"orderNumber": "507f1f77bcf86cd799439011",
"channelId": "12",
"segment": null,
"vendorId": "56",
"orderedQuantity": 2,
"shippedQuantity": 2,
"returnQuantity": 1,
"returnAmount": 10,
"fees": [
{
"type": "tax",
"value": 34.56,
"quantity": 12,
"refundAmount": 10.4
}
],
"giftCard": [
{
"giftCardNum": "453456765",
"amount": 50
}
],
"attributes": {},
"uom": null
}
]
}
],
"scratchedItems": [
{
"lineItemId": "2",
"itemId": "100043",
"sku": "SKU00043",
"quantity": 1,
"reasonCode": "<string>",
"subReasonCode": null,
"attributes": {},
"uom": null
}
],
"auditLogs": [
{
"auditType": "create",
"employeeId": "62272e917b12209e68751d94",
"auditTimestamp": "2022-05-12T09:24:54.804Z",
"source": "POS",
"note": "Note",
"attributes": {},
"updatedFields": [
{
"attributeName": "UOM",
"attributeOriginalValue": "PK"
}
]
}
],
"attributes": {}
}
'import requests
url = "https://prod01.oms.fabric.inc/api/v2/shipment/reship"
payload = {
"shipmentNum": "78974156816152",
"allocationId": "112345678912340",
"invoiceId": "5674156816152",
"poNumber": "1125",
"vendorId": "56",
"statusCode": "SHIPMENT_CREATED",
"type": "STANDARD",
"reshipmentReasonCode": "Order went missing",
"shipDate": "2022-06-06T07:58:30.996Z",
"locationNum": "132412",
"locationType": "DC",
"totalCartons": 2,
"masterTrackingNumber": "TX112345678",
"shipToId": "1",
"shipToAddress": {
"addressLine1": "888 Broadway",
"addressLine2": "505 suite",
"addressLine3": "<string>",
"addressLine4": "<string>",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "1003",
"type": "home",
"latitude": 134.13413,
"longitude": 757.0435
},
"recipient": [
{
"name": {
"first": "John",
"middle": "<string>",
"last": "Doe"
},
"email": "support@abc.inc",
"phone": {
"number": 10612345678,
"type": "MOBILE"
}
}
],
"cartons": [
{
"cartonNum": "1",
"cartonType": "Package",
"promisedDeliveryDate": "2022-05-26T07:58:30.996Z",
"estimatedShipDate": "2022-05-25T07:58:30.996Z",
"estimatedDeliveryDate": "2022-05-26T07:58:30.996Z",
"shipmentMethod": "ground",
"shipmentCarrier": "FEDEX",
"weight": "500 gram",
"trackingNumber": "1Z999AA10123456784",
"trackingURL": "https://fedex.com/tracking",
"trackingDetails": [
{
"event": "picked up",
"eventId": "627963716b19511e8a3a631b",
"timestamp": "2019-09-30T07:58:30.996Z",
"shipmentCarrier": "FEDEX",
"location": "Reno, NV",
"notes": {}
}
],
"items": [
{
"lineItemId": "1",
"itemId": "100023",
"sku": "SKU0023",
"orderId": "317736896",
"orderNumber": "507f1f77bcf86cd799439011",
"channelId": "12",
"segment": None,
"vendorId": "56",
"orderedQuantity": 2,
"shippedQuantity": 2,
"returnQuantity": 1,
"returnAmount": 10,
"fees": [
{
"type": "tax",
"value": 34.56,
"quantity": 12,
"refundAmount": 10.4
}
],
"giftCard": [
{
"giftCardNum": "453456765",
"amount": 50
}
],
"attributes": {},
"uom": None
}
]
}
],
"scratchedItems": [
{
"lineItemId": "2",
"itemId": "100043",
"sku": "SKU00043",
"quantity": 1,
"reasonCode": "<string>",
"subReasonCode": None,
"attributes": {},
"uom": None
}
],
"auditLogs": [
{
"auditType": "create",
"employeeId": "62272e917b12209e68751d94",
"auditTimestamp": "2022-05-12T09:24:54.804Z",
"source": "POS",
"note": "Note",
"attributes": {},
"updatedFields": [
{
"attributeName": "UOM",
"attributeOriginalValue": "PK"
}
]
}
],
"attributes": {}
}
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-site-context': '<x-site-context>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
shipmentNum: '78974156816152',
allocationId: '112345678912340',
invoiceId: '5674156816152',
poNumber: '1125',
vendorId: '56',
statusCode: 'SHIPMENT_CREATED',
type: 'STANDARD',
reshipmentReasonCode: 'Order went missing',
shipDate: '2022-06-06T07:58:30.996Z',
locationNum: '132412',
locationType: 'DC',
totalCartons: 2,
masterTrackingNumber: 'TX112345678',
shipToId: '1',
shipToAddress: {
addressLine1: '888 Broadway',
addressLine2: '505 suite',
addressLine3: '<string>',
addressLine4: '<string>',
city: 'New York',
state: 'NY',
country: 'USA',
postalCode: '1003',
type: 'home',
latitude: 134.13413,
longitude: 757.0435
},
recipient: [
{
name: {first: 'John', middle: '<string>', last: 'Doe'},
email: 'support@abc.inc',
phone: {number: 10612345678, type: 'MOBILE'}
}
],
cartons: [
{
cartonNum: '1',
cartonType: 'Package',
promisedDeliveryDate: '2022-05-26T07:58:30.996Z',
estimatedShipDate: '2022-05-25T07:58:30.996Z',
estimatedDeliveryDate: '2022-05-26T07:58:30.996Z',
shipmentMethod: 'ground',
shipmentCarrier: 'FEDEX',
weight: '500 gram',
trackingNumber: '1Z999AA10123456784',
trackingURL: 'https://fedex.com/tracking',
trackingDetails: [
{
event: 'picked up',
eventId: '627963716b19511e8a3a631b',
timestamp: '2019-09-30T07:58:30.996Z',
shipmentCarrier: 'FEDEX',
location: 'Reno, NV',
notes: {}
}
],
items: [
{
lineItemId: '1',
itemId: '100023',
sku: 'SKU0023',
orderId: '317736896',
orderNumber: '507f1f77bcf86cd799439011',
channelId: '12',
segment: null,
vendorId: '56',
orderedQuantity: 2,
shippedQuantity: 2,
returnQuantity: 1,
returnAmount: 10,
fees: [{type: 'tax', value: 34.56, quantity: 12, refundAmount: 10.4}],
giftCard: [{giftCardNum: '453456765', amount: 50}],
attributes: {},
uom: null
}
]
}
],
scratchedItems: [
{
lineItemId: '2',
itemId: '100043',
sku: 'SKU00043',
quantity: 1,
reasonCode: '<string>',
subReasonCode: null,
attributes: {},
uom: null
}
],
auditLogs: [
{
auditType: 'create',
employeeId: '62272e917b12209e68751d94',
auditTimestamp: '2022-05-12T09:24:54.804Z',
source: 'POS',
note: 'Note',
attributes: {},
updatedFields: [{attributeName: 'UOM', attributeOriginalValue: 'PK'}]
}
],
attributes: {}
})
};
fetch('https://prod01.oms.fabric.inc/api/v2/shipment/reship', 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://prod01.oms.fabric.inc/api/v2/shipment/reship",
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([
'shipmentNum' => '78974156816152',
'allocationId' => '112345678912340',
'invoiceId' => '5674156816152',
'poNumber' => '1125',
'vendorId' => '56',
'statusCode' => 'SHIPMENT_CREATED',
'type' => 'STANDARD',
'reshipmentReasonCode' => 'Order went missing',
'shipDate' => '2022-06-06T07:58:30.996Z',
'locationNum' => '132412',
'locationType' => 'DC',
'totalCartons' => 2,
'masterTrackingNumber' => 'TX112345678',
'shipToId' => '1',
'shipToAddress' => [
'addressLine1' => '888 Broadway',
'addressLine2' => '505 suite',
'addressLine3' => '<string>',
'addressLine4' => '<string>',
'city' => 'New York',
'state' => 'NY',
'country' => 'USA',
'postalCode' => '1003',
'type' => 'home',
'latitude' => 134.13413,
'longitude' => 757.0435
],
'recipient' => [
[
'name' => [
'first' => 'John',
'middle' => '<string>',
'last' => 'Doe'
],
'email' => 'support@abc.inc',
'phone' => [
'number' => 10612345678,
'type' => 'MOBILE'
]
]
],
'cartons' => [
[
'cartonNum' => '1',
'cartonType' => 'Package',
'promisedDeliveryDate' => '2022-05-26T07:58:30.996Z',
'estimatedShipDate' => '2022-05-25T07:58:30.996Z',
'estimatedDeliveryDate' => '2022-05-26T07:58:30.996Z',
'shipmentMethod' => 'ground',
'shipmentCarrier' => 'FEDEX',
'weight' => '500 gram',
'trackingNumber' => '1Z999AA10123456784',
'trackingURL' => 'https://fedex.com/tracking',
'trackingDetails' => [
[
'event' => 'picked up',
'eventId' => '627963716b19511e8a3a631b',
'timestamp' => '2019-09-30T07:58:30.996Z',
'shipmentCarrier' => 'FEDEX',
'location' => 'Reno, NV',
'notes' => [
]
]
],
'items' => [
[
'lineItemId' => '1',
'itemId' => '100023',
'sku' => 'SKU0023',
'orderId' => '317736896',
'orderNumber' => '507f1f77bcf86cd799439011',
'channelId' => '12',
'segment' => null,
'vendorId' => '56',
'orderedQuantity' => 2,
'shippedQuantity' => 2,
'returnQuantity' => 1,
'returnAmount' => 10,
'fees' => [
[
'type' => 'tax',
'value' => 34.56,
'quantity' => 12,
'refundAmount' => 10.4
]
],
'giftCard' => [
[
'giftCardNum' => '453456765',
'amount' => 50
]
],
'attributes' => [
],
'uom' => null
]
]
]
],
'scratchedItems' => [
[
'lineItemId' => '2',
'itemId' => '100043',
'sku' => 'SKU00043',
'quantity' => 1,
'reasonCode' => '<string>',
'subReasonCode' => null,
'attributes' => [
],
'uom' => null
]
],
'auditLogs' => [
[
'auditType' => 'create',
'employeeId' => '62272e917b12209e68751d94',
'auditTimestamp' => '2022-05-12T09:24:54.804Z',
'source' => 'POS',
'note' => 'Note',
'attributes' => [
],
'updatedFields' => [
[
'attributeName' => 'UOM',
'attributeOriginalValue' => 'PK'
]
]
]
],
'attributes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-site-context: <x-site-context>"
],
]);
$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://prod01.oms.fabric.inc/api/v2/shipment/reship"
payload := strings.NewReader("{\n \"shipmentNum\": \"78974156816152\",\n \"allocationId\": \"112345678912340\",\n \"invoiceId\": \"5674156816152\",\n \"poNumber\": \"1125\",\n \"vendorId\": \"56\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"type\": \"STANDARD\",\n \"reshipmentReasonCode\": \"Order went missing\",\n \"shipDate\": \"2022-06-06T07:58:30.996Z\",\n \"locationNum\": \"132412\",\n \"locationType\": \"DC\",\n \"totalCartons\": 2,\n \"masterTrackingNumber\": \"TX112345678\",\n \"shipToId\": \"1\",\n \"shipToAddress\": {\n \"addressLine1\": \"888 Broadway\",\n \"addressLine2\": \"505 suite\",\n \"addressLine3\": \"<string>\",\n \"addressLine4\": \"<string>\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"1003\",\n \"type\": \"home\",\n \"latitude\": 134.13413,\n \"longitude\": 757.0435\n },\n \"recipient\": [\n {\n \"name\": {\n \"first\": \"John\",\n \"middle\": \"<string>\",\n \"last\": \"Doe\"\n },\n \"email\": \"support@abc.inc\",\n \"phone\": {\n \"number\": 10612345678,\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"cartons\": [\n {\n \"cartonNum\": \"1\",\n \"cartonType\": \"Package\",\n \"promisedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2022-05-25T07:58:30.996Z\",\n \"estimatedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"shipmentMethod\": \"ground\",\n \"shipmentCarrier\": \"FEDEX\",\n \"weight\": \"500 gram\",\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"trackingDetails\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"timestamp\": \"2019-09-30T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"location\": \"Reno, NV\",\n \"notes\": {}\n }\n ],\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"itemId\": \"100023\",\n \"sku\": \"SKU0023\",\n \"orderId\": \"317736896\",\n \"orderNumber\": \"507f1f77bcf86cd799439011\",\n \"channelId\": \"12\",\n \"segment\": null,\n \"vendorId\": \"56\",\n \"orderedQuantity\": 2,\n \"shippedQuantity\": 2,\n \"returnQuantity\": 1,\n \"returnAmount\": 10,\n \"fees\": [\n {\n \"type\": \"tax\",\n \"value\": 34.56,\n \"quantity\": 12,\n \"refundAmount\": 10.4\n }\n ],\n \"giftCard\": [\n {\n \"giftCardNum\": \"453456765\",\n \"amount\": 50\n }\n ],\n \"attributes\": {},\n \"uom\": null\n }\n ]\n }\n ],\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"itemId\": \"100043\",\n \"sku\": \"SKU00043\",\n \"quantity\": 1,\n \"reasonCode\": \"<string>\",\n \"subReasonCode\": null,\n \"attributes\": {},\n \"uom\": null\n }\n ],\n \"auditLogs\": [\n {\n \"auditType\": \"create\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"auditTimestamp\": \"2022-05-12T09:24:54.804Z\",\n \"source\": \"POS\",\n \"note\": \"Note\",\n \"attributes\": {},\n \"updatedFields\": [\n {\n \"attributeName\": \"UOM\",\n \"attributeOriginalValue\": \"PK\"\n }\n ]\n }\n ],\n \"attributes\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-site-context", "<x-site-context>")
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://prod01.oms.fabric.inc/api/v2/shipment/reship")
.header("x-site-context", "<x-site-context>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipmentNum\": \"78974156816152\",\n \"allocationId\": \"112345678912340\",\n \"invoiceId\": \"5674156816152\",\n \"poNumber\": \"1125\",\n \"vendorId\": \"56\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"type\": \"STANDARD\",\n \"reshipmentReasonCode\": \"Order went missing\",\n \"shipDate\": \"2022-06-06T07:58:30.996Z\",\n \"locationNum\": \"132412\",\n \"locationType\": \"DC\",\n \"totalCartons\": 2,\n \"masterTrackingNumber\": \"TX112345678\",\n \"shipToId\": \"1\",\n \"shipToAddress\": {\n \"addressLine1\": \"888 Broadway\",\n \"addressLine2\": \"505 suite\",\n \"addressLine3\": \"<string>\",\n \"addressLine4\": \"<string>\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"1003\",\n \"type\": \"home\",\n \"latitude\": 134.13413,\n \"longitude\": 757.0435\n },\n \"recipient\": [\n {\n \"name\": {\n \"first\": \"John\",\n \"middle\": \"<string>\",\n \"last\": \"Doe\"\n },\n \"email\": \"support@abc.inc\",\n \"phone\": {\n \"number\": 10612345678,\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"cartons\": [\n {\n \"cartonNum\": \"1\",\n \"cartonType\": \"Package\",\n \"promisedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2022-05-25T07:58:30.996Z\",\n \"estimatedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"shipmentMethod\": \"ground\",\n \"shipmentCarrier\": \"FEDEX\",\n \"weight\": \"500 gram\",\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"trackingDetails\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"timestamp\": \"2019-09-30T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"location\": \"Reno, NV\",\n \"notes\": {}\n }\n ],\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"itemId\": \"100023\",\n \"sku\": \"SKU0023\",\n \"orderId\": \"317736896\",\n \"orderNumber\": \"507f1f77bcf86cd799439011\",\n \"channelId\": \"12\",\n \"segment\": null,\n \"vendorId\": \"56\",\n \"orderedQuantity\": 2,\n \"shippedQuantity\": 2,\n \"returnQuantity\": 1,\n \"returnAmount\": 10,\n \"fees\": [\n {\n \"type\": \"tax\",\n \"value\": 34.56,\n \"quantity\": 12,\n \"refundAmount\": 10.4\n }\n ],\n \"giftCard\": [\n {\n \"giftCardNum\": \"453456765\",\n \"amount\": 50\n }\n ],\n \"attributes\": {},\n \"uom\": null\n }\n ]\n }\n ],\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"itemId\": \"100043\",\n \"sku\": \"SKU00043\",\n \"quantity\": 1,\n \"reasonCode\": \"<string>\",\n \"subReasonCode\": null,\n \"attributes\": {},\n \"uom\": null\n }\n ],\n \"auditLogs\": [\n {\n \"auditType\": \"create\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"auditTimestamp\": \"2022-05-12T09:24:54.804Z\",\n \"source\": \"POS\",\n \"note\": \"Note\",\n \"attributes\": {},\n \"updatedFields\": [\n {\n \"attributeName\": \"UOM\",\n \"attributeOriginalValue\": \"PK\"\n }\n ]\n }\n ],\n \"attributes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01.oms.fabric.inc/api/v2/shipment/reship")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipmentNum\": \"78974156816152\",\n \"allocationId\": \"112345678912340\",\n \"invoiceId\": \"5674156816152\",\n \"poNumber\": \"1125\",\n \"vendorId\": \"56\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"type\": \"STANDARD\",\n \"reshipmentReasonCode\": \"Order went missing\",\n \"shipDate\": \"2022-06-06T07:58:30.996Z\",\n \"locationNum\": \"132412\",\n \"locationType\": \"DC\",\n \"totalCartons\": 2,\n \"masterTrackingNumber\": \"TX112345678\",\n \"shipToId\": \"1\",\n \"shipToAddress\": {\n \"addressLine1\": \"888 Broadway\",\n \"addressLine2\": \"505 suite\",\n \"addressLine3\": \"<string>\",\n \"addressLine4\": \"<string>\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"1003\",\n \"type\": \"home\",\n \"latitude\": 134.13413,\n \"longitude\": 757.0435\n },\n \"recipient\": [\n {\n \"name\": {\n \"first\": \"John\",\n \"middle\": \"<string>\",\n \"last\": \"Doe\"\n },\n \"email\": \"support@abc.inc\",\n \"phone\": {\n \"number\": 10612345678,\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"cartons\": [\n {\n \"cartonNum\": \"1\",\n \"cartonType\": \"Package\",\n \"promisedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2022-05-25T07:58:30.996Z\",\n \"estimatedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"shipmentMethod\": \"ground\",\n \"shipmentCarrier\": \"FEDEX\",\n \"weight\": \"500 gram\",\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"trackingDetails\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"timestamp\": \"2019-09-30T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"location\": \"Reno, NV\",\n \"notes\": {}\n }\n ],\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"itemId\": \"100023\",\n \"sku\": \"SKU0023\",\n \"orderId\": \"317736896\",\n \"orderNumber\": \"507f1f77bcf86cd799439011\",\n \"channelId\": \"12\",\n \"segment\": null,\n \"vendorId\": \"56\",\n \"orderedQuantity\": 2,\n \"shippedQuantity\": 2,\n \"returnQuantity\": 1,\n \"returnAmount\": 10,\n \"fees\": [\n {\n \"type\": \"tax\",\n \"value\": 34.56,\n \"quantity\": 12,\n \"refundAmount\": 10.4\n }\n ],\n \"giftCard\": [\n {\n \"giftCardNum\": \"453456765\",\n \"amount\": 50\n }\n ],\n \"attributes\": {},\n \"uom\": null\n }\n ]\n }\n ],\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"itemId\": \"100043\",\n \"sku\": \"SKU00043\",\n \"quantity\": 1,\n \"reasonCode\": \"<string>\",\n \"subReasonCode\": null,\n \"attributes\": {},\n \"uom\": null\n }\n ],\n \"auditLogs\": [\n {\n \"auditType\": \"create\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"auditTimestamp\": \"2022-05-12T09:24:54.804Z\",\n \"source\": \"POS\",\n \"note\": \"Note\",\n \"attributes\": {},\n \"updatedFields\": [\n {\n \"attributeName\": \"UOM\",\n \"attributeOriginalValue\": \"PK\"\n }\n ]\n }\n ],\n \"attributes\": {}\n}"
response = http.request(request)
puts response.read_body{
"shipmentId": "627963716b19511e8a3a631b",
"shipmentNum": "78974156816152",
"invoiceId": "5674156816152",
"allocationId": "112345678912340",
"orderNumber": [
"112345678912340",
"112345678912340"
],
"poNumber": "1125",
"vendorId": "56",
"statusCode": "SHIPPED",
"type": "STANDARD",
"reshipmentReasonCode": "Order went missing",
"shipDate": "2022-06-06T07:58:30.996Z",
"locationNum": "132412",
"locationType": "DC",
"totalCartons": 2,
"masterTrackingNumber": "TX112345678",
"shipToId": "1",
"shipToAddress": {
"addressLine1": "888 Broadway",
"addressLine2": "505 suite",
"addressLine3": "<string>",
"addressLine4": "<string>",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "1003",
"type": "home",
"latitude": 134.13413,
"longitude": 757.0435
},
"recipient": [
{
"name": {
"first": "John",
"middle": "<string>",
"last": "Doe"
},
"email": "support@abc.inc",
"phone": {
"number": 10612345678,
"type": "MOBILE"
}
}
],
"cartons": [
{
"cartonNum": "1",
"cartonType": "Package",
"promisedDeliveryDate": "2022-05-26T07:58:30.996Z",
"estimatedShipDate": "2022-05-25T07:58:30.996Z",
"estimatedDeliveryDate": "2022-05-26T07:58:30.996Z",
"shipmentMethod": "ground",
"shipmentCarrier": "FEDEX",
"weight": "500 gram",
"trackingNumber": "1Z999AA10123456784",
"trackingURL": "https://fedex.com/tracking",
"trackingDetails": [
{
"event": "picked up",
"eventId": "627963716b19511e8a3a631b",
"timestamp": "2019-09-30T07:58:30.996Z",
"shipmentCarrier": "FEDEX",
"location": "Reno, NV",
"notes": {}
}
],
"items": [
{
"shipmentLineItemId": "607f1f77bcf86cd799439011",
"orderId": "317736896",
"orderNumber": "507f1f77bcf86cd799439011",
"lineItemId": "1",
"itemId": "100023",
"sku": "SKU0023",
"channelId": "12",
"segment": null,
"vendorId": "56",
"orderedQuantity": 2,
"shippedQuantity": 2,
"returnQuantity": 1,
"returnAmount": 10,
"fees": [
{
"type": "tax",
"value": 34.56,
"quantity": 12,
"refundAmount": 10.4
}
],
"giftCard": [
{
"giftCardNum": "453456765",
"amount": 50,
"giftCardStatus": "ACTIVE",
"giftCardActiveRequestDate": "2022-05-26T07:58:30.996Z",
"giftCardActiveDate": "2022-06-26T07:58:30.996Z"
}
],
"attributes": {},
"uom": null
}
]
}
],
"scratchedItems": [
{
"orderId": "507f1f77bcf86cd799439012",
"lineItemId": "2",
"itemId": "100043",
"sku": "SKU00043",
"quantity": 1,
"reasonCode": "<string>",
"subReasonCode": "<string>",
"attributes": {},
"uom": null
}
],
"createdAt": "2022-06-06T07:58:30.996Z",
"updatedAt": "2022-06-06T07:58:30.996Z",
"auditLogs": [
{
"auditType": "create",
"employeeId": "62272e917b12209e68751d94",
"auditTimestamp": "2022-05-12T09:24:54.804Z",
"source": "POS",
"note": "Note",
"attributes": {},
"updatedFields": [
{
"attributeName": "UOM",
"attributeOriginalValue": "PK"
}
]
}
],
"attributes": {}
}{
"message": "Bad Request"
}{
"message": "Object Not Found."
}{
"message": "Internal Server Error"
}Create reshipment
Creates reshipment when package goes missing before it is shipped
curl --request POST \
--url https://prod01.oms.fabric.inc/api/v2/shipment/reship \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"shipmentNum": "78974156816152",
"allocationId": "112345678912340",
"invoiceId": "5674156816152",
"poNumber": "1125",
"vendorId": "56",
"statusCode": "SHIPMENT_CREATED",
"type": "STANDARD",
"reshipmentReasonCode": "Order went missing",
"shipDate": "2022-06-06T07:58:30.996Z",
"locationNum": "132412",
"locationType": "DC",
"totalCartons": 2,
"masterTrackingNumber": "TX112345678",
"shipToId": "1",
"shipToAddress": {
"addressLine1": "888 Broadway",
"addressLine2": "505 suite",
"addressLine3": "<string>",
"addressLine4": "<string>",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "1003",
"type": "home",
"latitude": 134.13413,
"longitude": 757.0435
},
"recipient": [
{
"name": {
"first": "John",
"middle": "<string>",
"last": "Doe"
},
"email": "support@abc.inc",
"phone": {
"number": 10612345678,
"type": "MOBILE"
}
}
],
"cartons": [
{
"cartonNum": "1",
"cartonType": "Package",
"promisedDeliveryDate": "2022-05-26T07:58:30.996Z",
"estimatedShipDate": "2022-05-25T07:58:30.996Z",
"estimatedDeliveryDate": "2022-05-26T07:58:30.996Z",
"shipmentMethod": "ground",
"shipmentCarrier": "FEDEX",
"weight": "500 gram",
"trackingNumber": "1Z999AA10123456784",
"trackingURL": "https://fedex.com/tracking",
"trackingDetails": [
{
"event": "picked up",
"eventId": "627963716b19511e8a3a631b",
"timestamp": "2019-09-30T07:58:30.996Z",
"shipmentCarrier": "FEDEX",
"location": "Reno, NV",
"notes": {}
}
],
"items": [
{
"lineItemId": "1",
"itemId": "100023",
"sku": "SKU0023",
"orderId": "317736896",
"orderNumber": "507f1f77bcf86cd799439011",
"channelId": "12",
"segment": null,
"vendorId": "56",
"orderedQuantity": 2,
"shippedQuantity": 2,
"returnQuantity": 1,
"returnAmount": 10,
"fees": [
{
"type": "tax",
"value": 34.56,
"quantity": 12,
"refundAmount": 10.4
}
],
"giftCard": [
{
"giftCardNum": "453456765",
"amount": 50
}
],
"attributes": {},
"uom": null
}
]
}
],
"scratchedItems": [
{
"lineItemId": "2",
"itemId": "100043",
"sku": "SKU00043",
"quantity": 1,
"reasonCode": "<string>",
"subReasonCode": null,
"attributes": {},
"uom": null
}
],
"auditLogs": [
{
"auditType": "create",
"employeeId": "62272e917b12209e68751d94",
"auditTimestamp": "2022-05-12T09:24:54.804Z",
"source": "POS",
"note": "Note",
"attributes": {},
"updatedFields": [
{
"attributeName": "UOM",
"attributeOriginalValue": "PK"
}
]
}
],
"attributes": {}
}
'import requests
url = "https://prod01.oms.fabric.inc/api/v2/shipment/reship"
payload = {
"shipmentNum": "78974156816152",
"allocationId": "112345678912340",
"invoiceId": "5674156816152",
"poNumber": "1125",
"vendorId": "56",
"statusCode": "SHIPMENT_CREATED",
"type": "STANDARD",
"reshipmentReasonCode": "Order went missing",
"shipDate": "2022-06-06T07:58:30.996Z",
"locationNum": "132412",
"locationType": "DC",
"totalCartons": 2,
"masterTrackingNumber": "TX112345678",
"shipToId": "1",
"shipToAddress": {
"addressLine1": "888 Broadway",
"addressLine2": "505 suite",
"addressLine3": "<string>",
"addressLine4": "<string>",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "1003",
"type": "home",
"latitude": 134.13413,
"longitude": 757.0435
},
"recipient": [
{
"name": {
"first": "John",
"middle": "<string>",
"last": "Doe"
},
"email": "support@abc.inc",
"phone": {
"number": 10612345678,
"type": "MOBILE"
}
}
],
"cartons": [
{
"cartonNum": "1",
"cartonType": "Package",
"promisedDeliveryDate": "2022-05-26T07:58:30.996Z",
"estimatedShipDate": "2022-05-25T07:58:30.996Z",
"estimatedDeliveryDate": "2022-05-26T07:58:30.996Z",
"shipmentMethod": "ground",
"shipmentCarrier": "FEDEX",
"weight": "500 gram",
"trackingNumber": "1Z999AA10123456784",
"trackingURL": "https://fedex.com/tracking",
"trackingDetails": [
{
"event": "picked up",
"eventId": "627963716b19511e8a3a631b",
"timestamp": "2019-09-30T07:58:30.996Z",
"shipmentCarrier": "FEDEX",
"location": "Reno, NV",
"notes": {}
}
],
"items": [
{
"lineItemId": "1",
"itemId": "100023",
"sku": "SKU0023",
"orderId": "317736896",
"orderNumber": "507f1f77bcf86cd799439011",
"channelId": "12",
"segment": None,
"vendorId": "56",
"orderedQuantity": 2,
"shippedQuantity": 2,
"returnQuantity": 1,
"returnAmount": 10,
"fees": [
{
"type": "tax",
"value": 34.56,
"quantity": 12,
"refundAmount": 10.4
}
],
"giftCard": [
{
"giftCardNum": "453456765",
"amount": 50
}
],
"attributes": {},
"uom": None
}
]
}
],
"scratchedItems": [
{
"lineItemId": "2",
"itemId": "100043",
"sku": "SKU00043",
"quantity": 1,
"reasonCode": "<string>",
"subReasonCode": None,
"attributes": {},
"uom": None
}
],
"auditLogs": [
{
"auditType": "create",
"employeeId": "62272e917b12209e68751d94",
"auditTimestamp": "2022-05-12T09:24:54.804Z",
"source": "POS",
"note": "Note",
"attributes": {},
"updatedFields": [
{
"attributeName": "UOM",
"attributeOriginalValue": "PK"
}
]
}
],
"attributes": {}
}
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-site-context': '<x-site-context>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
shipmentNum: '78974156816152',
allocationId: '112345678912340',
invoiceId: '5674156816152',
poNumber: '1125',
vendorId: '56',
statusCode: 'SHIPMENT_CREATED',
type: 'STANDARD',
reshipmentReasonCode: 'Order went missing',
shipDate: '2022-06-06T07:58:30.996Z',
locationNum: '132412',
locationType: 'DC',
totalCartons: 2,
masterTrackingNumber: 'TX112345678',
shipToId: '1',
shipToAddress: {
addressLine1: '888 Broadway',
addressLine2: '505 suite',
addressLine3: '<string>',
addressLine4: '<string>',
city: 'New York',
state: 'NY',
country: 'USA',
postalCode: '1003',
type: 'home',
latitude: 134.13413,
longitude: 757.0435
},
recipient: [
{
name: {first: 'John', middle: '<string>', last: 'Doe'},
email: 'support@abc.inc',
phone: {number: 10612345678, type: 'MOBILE'}
}
],
cartons: [
{
cartonNum: '1',
cartonType: 'Package',
promisedDeliveryDate: '2022-05-26T07:58:30.996Z',
estimatedShipDate: '2022-05-25T07:58:30.996Z',
estimatedDeliveryDate: '2022-05-26T07:58:30.996Z',
shipmentMethod: 'ground',
shipmentCarrier: 'FEDEX',
weight: '500 gram',
trackingNumber: '1Z999AA10123456784',
trackingURL: 'https://fedex.com/tracking',
trackingDetails: [
{
event: 'picked up',
eventId: '627963716b19511e8a3a631b',
timestamp: '2019-09-30T07:58:30.996Z',
shipmentCarrier: 'FEDEX',
location: 'Reno, NV',
notes: {}
}
],
items: [
{
lineItemId: '1',
itemId: '100023',
sku: 'SKU0023',
orderId: '317736896',
orderNumber: '507f1f77bcf86cd799439011',
channelId: '12',
segment: null,
vendorId: '56',
orderedQuantity: 2,
shippedQuantity: 2,
returnQuantity: 1,
returnAmount: 10,
fees: [{type: 'tax', value: 34.56, quantity: 12, refundAmount: 10.4}],
giftCard: [{giftCardNum: '453456765', amount: 50}],
attributes: {},
uom: null
}
]
}
],
scratchedItems: [
{
lineItemId: '2',
itemId: '100043',
sku: 'SKU00043',
quantity: 1,
reasonCode: '<string>',
subReasonCode: null,
attributes: {},
uom: null
}
],
auditLogs: [
{
auditType: 'create',
employeeId: '62272e917b12209e68751d94',
auditTimestamp: '2022-05-12T09:24:54.804Z',
source: 'POS',
note: 'Note',
attributes: {},
updatedFields: [{attributeName: 'UOM', attributeOriginalValue: 'PK'}]
}
],
attributes: {}
})
};
fetch('https://prod01.oms.fabric.inc/api/v2/shipment/reship', 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://prod01.oms.fabric.inc/api/v2/shipment/reship",
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([
'shipmentNum' => '78974156816152',
'allocationId' => '112345678912340',
'invoiceId' => '5674156816152',
'poNumber' => '1125',
'vendorId' => '56',
'statusCode' => 'SHIPMENT_CREATED',
'type' => 'STANDARD',
'reshipmentReasonCode' => 'Order went missing',
'shipDate' => '2022-06-06T07:58:30.996Z',
'locationNum' => '132412',
'locationType' => 'DC',
'totalCartons' => 2,
'masterTrackingNumber' => 'TX112345678',
'shipToId' => '1',
'shipToAddress' => [
'addressLine1' => '888 Broadway',
'addressLine2' => '505 suite',
'addressLine3' => '<string>',
'addressLine4' => '<string>',
'city' => 'New York',
'state' => 'NY',
'country' => 'USA',
'postalCode' => '1003',
'type' => 'home',
'latitude' => 134.13413,
'longitude' => 757.0435
],
'recipient' => [
[
'name' => [
'first' => 'John',
'middle' => '<string>',
'last' => 'Doe'
],
'email' => 'support@abc.inc',
'phone' => [
'number' => 10612345678,
'type' => 'MOBILE'
]
]
],
'cartons' => [
[
'cartonNum' => '1',
'cartonType' => 'Package',
'promisedDeliveryDate' => '2022-05-26T07:58:30.996Z',
'estimatedShipDate' => '2022-05-25T07:58:30.996Z',
'estimatedDeliveryDate' => '2022-05-26T07:58:30.996Z',
'shipmentMethod' => 'ground',
'shipmentCarrier' => 'FEDEX',
'weight' => '500 gram',
'trackingNumber' => '1Z999AA10123456784',
'trackingURL' => 'https://fedex.com/tracking',
'trackingDetails' => [
[
'event' => 'picked up',
'eventId' => '627963716b19511e8a3a631b',
'timestamp' => '2019-09-30T07:58:30.996Z',
'shipmentCarrier' => 'FEDEX',
'location' => 'Reno, NV',
'notes' => [
]
]
],
'items' => [
[
'lineItemId' => '1',
'itemId' => '100023',
'sku' => 'SKU0023',
'orderId' => '317736896',
'orderNumber' => '507f1f77bcf86cd799439011',
'channelId' => '12',
'segment' => null,
'vendorId' => '56',
'orderedQuantity' => 2,
'shippedQuantity' => 2,
'returnQuantity' => 1,
'returnAmount' => 10,
'fees' => [
[
'type' => 'tax',
'value' => 34.56,
'quantity' => 12,
'refundAmount' => 10.4
]
],
'giftCard' => [
[
'giftCardNum' => '453456765',
'amount' => 50
]
],
'attributes' => [
],
'uom' => null
]
]
]
],
'scratchedItems' => [
[
'lineItemId' => '2',
'itemId' => '100043',
'sku' => 'SKU00043',
'quantity' => 1,
'reasonCode' => '<string>',
'subReasonCode' => null,
'attributes' => [
],
'uom' => null
]
],
'auditLogs' => [
[
'auditType' => 'create',
'employeeId' => '62272e917b12209e68751d94',
'auditTimestamp' => '2022-05-12T09:24:54.804Z',
'source' => 'POS',
'note' => 'Note',
'attributes' => [
],
'updatedFields' => [
[
'attributeName' => 'UOM',
'attributeOriginalValue' => 'PK'
]
]
]
],
'attributes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-site-context: <x-site-context>"
],
]);
$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://prod01.oms.fabric.inc/api/v2/shipment/reship"
payload := strings.NewReader("{\n \"shipmentNum\": \"78974156816152\",\n \"allocationId\": \"112345678912340\",\n \"invoiceId\": \"5674156816152\",\n \"poNumber\": \"1125\",\n \"vendorId\": \"56\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"type\": \"STANDARD\",\n \"reshipmentReasonCode\": \"Order went missing\",\n \"shipDate\": \"2022-06-06T07:58:30.996Z\",\n \"locationNum\": \"132412\",\n \"locationType\": \"DC\",\n \"totalCartons\": 2,\n \"masterTrackingNumber\": \"TX112345678\",\n \"shipToId\": \"1\",\n \"shipToAddress\": {\n \"addressLine1\": \"888 Broadway\",\n \"addressLine2\": \"505 suite\",\n \"addressLine3\": \"<string>\",\n \"addressLine4\": \"<string>\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"1003\",\n \"type\": \"home\",\n \"latitude\": 134.13413,\n \"longitude\": 757.0435\n },\n \"recipient\": [\n {\n \"name\": {\n \"first\": \"John\",\n \"middle\": \"<string>\",\n \"last\": \"Doe\"\n },\n \"email\": \"support@abc.inc\",\n \"phone\": {\n \"number\": 10612345678,\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"cartons\": [\n {\n \"cartonNum\": \"1\",\n \"cartonType\": \"Package\",\n \"promisedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2022-05-25T07:58:30.996Z\",\n \"estimatedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"shipmentMethod\": \"ground\",\n \"shipmentCarrier\": \"FEDEX\",\n \"weight\": \"500 gram\",\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"trackingDetails\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"timestamp\": \"2019-09-30T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"location\": \"Reno, NV\",\n \"notes\": {}\n }\n ],\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"itemId\": \"100023\",\n \"sku\": \"SKU0023\",\n \"orderId\": \"317736896\",\n \"orderNumber\": \"507f1f77bcf86cd799439011\",\n \"channelId\": \"12\",\n \"segment\": null,\n \"vendorId\": \"56\",\n \"orderedQuantity\": 2,\n \"shippedQuantity\": 2,\n \"returnQuantity\": 1,\n \"returnAmount\": 10,\n \"fees\": [\n {\n \"type\": \"tax\",\n \"value\": 34.56,\n \"quantity\": 12,\n \"refundAmount\": 10.4\n }\n ],\n \"giftCard\": [\n {\n \"giftCardNum\": \"453456765\",\n \"amount\": 50\n }\n ],\n \"attributes\": {},\n \"uom\": null\n }\n ]\n }\n ],\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"itemId\": \"100043\",\n \"sku\": \"SKU00043\",\n \"quantity\": 1,\n \"reasonCode\": \"<string>\",\n \"subReasonCode\": null,\n \"attributes\": {},\n \"uom\": null\n }\n ],\n \"auditLogs\": [\n {\n \"auditType\": \"create\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"auditTimestamp\": \"2022-05-12T09:24:54.804Z\",\n \"source\": \"POS\",\n \"note\": \"Note\",\n \"attributes\": {},\n \"updatedFields\": [\n {\n \"attributeName\": \"UOM\",\n \"attributeOriginalValue\": \"PK\"\n }\n ]\n }\n ],\n \"attributes\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-site-context", "<x-site-context>")
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://prod01.oms.fabric.inc/api/v2/shipment/reship")
.header("x-site-context", "<x-site-context>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipmentNum\": \"78974156816152\",\n \"allocationId\": \"112345678912340\",\n \"invoiceId\": \"5674156816152\",\n \"poNumber\": \"1125\",\n \"vendorId\": \"56\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"type\": \"STANDARD\",\n \"reshipmentReasonCode\": \"Order went missing\",\n \"shipDate\": \"2022-06-06T07:58:30.996Z\",\n \"locationNum\": \"132412\",\n \"locationType\": \"DC\",\n \"totalCartons\": 2,\n \"masterTrackingNumber\": \"TX112345678\",\n \"shipToId\": \"1\",\n \"shipToAddress\": {\n \"addressLine1\": \"888 Broadway\",\n \"addressLine2\": \"505 suite\",\n \"addressLine3\": \"<string>\",\n \"addressLine4\": \"<string>\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"1003\",\n \"type\": \"home\",\n \"latitude\": 134.13413,\n \"longitude\": 757.0435\n },\n \"recipient\": [\n {\n \"name\": {\n \"first\": \"John\",\n \"middle\": \"<string>\",\n \"last\": \"Doe\"\n },\n \"email\": \"support@abc.inc\",\n \"phone\": {\n \"number\": 10612345678,\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"cartons\": [\n {\n \"cartonNum\": \"1\",\n \"cartonType\": \"Package\",\n \"promisedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2022-05-25T07:58:30.996Z\",\n \"estimatedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"shipmentMethod\": \"ground\",\n \"shipmentCarrier\": \"FEDEX\",\n \"weight\": \"500 gram\",\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"trackingDetails\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"timestamp\": \"2019-09-30T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"location\": \"Reno, NV\",\n \"notes\": {}\n }\n ],\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"itemId\": \"100023\",\n \"sku\": \"SKU0023\",\n \"orderId\": \"317736896\",\n \"orderNumber\": \"507f1f77bcf86cd799439011\",\n \"channelId\": \"12\",\n \"segment\": null,\n \"vendorId\": \"56\",\n \"orderedQuantity\": 2,\n \"shippedQuantity\": 2,\n \"returnQuantity\": 1,\n \"returnAmount\": 10,\n \"fees\": [\n {\n \"type\": \"tax\",\n \"value\": 34.56,\n \"quantity\": 12,\n \"refundAmount\": 10.4\n }\n ],\n \"giftCard\": [\n {\n \"giftCardNum\": \"453456765\",\n \"amount\": 50\n }\n ],\n \"attributes\": {},\n \"uom\": null\n }\n ]\n }\n ],\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"itemId\": \"100043\",\n \"sku\": \"SKU00043\",\n \"quantity\": 1,\n \"reasonCode\": \"<string>\",\n \"subReasonCode\": null,\n \"attributes\": {},\n \"uom\": null\n }\n ],\n \"auditLogs\": [\n {\n \"auditType\": \"create\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"auditTimestamp\": \"2022-05-12T09:24:54.804Z\",\n \"source\": \"POS\",\n \"note\": \"Note\",\n \"attributes\": {},\n \"updatedFields\": [\n {\n \"attributeName\": \"UOM\",\n \"attributeOriginalValue\": \"PK\"\n }\n ]\n }\n ],\n \"attributes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01.oms.fabric.inc/api/v2/shipment/reship")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipmentNum\": \"78974156816152\",\n \"allocationId\": \"112345678912340\",\n \"invoiceId\": \"5674156816152\",\n \"poNumber\": \"1125\",\n \"vendorId\": \"56\",\n \"statusCode\": \"SHIPMENT_CREATED\",\n \"type\": \"STANDARD\",\n \"reshipmentReasonCode\": \"Order went missing\",\n \"shipDate\": \"2022-06-06T07:58:30.996Z\",\n \"locationNum\": \"132412\",\n \"locationType\": \"DC\",\n \"totalCartons\": 2,\n \"masterTrackingNumber\": \"TX112345678\",\n \"shipToId\": \"1\",\n \"shipToAddress\": {\n \"addressLine1\": \"888 Broadway\",\n \"addressLine2\": \"505 suite\",\n \"addressLine3\": \"<string>\",\n \"addressLine4\": \"<string>\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"1003\",\n \"type\": \"home\",\n \"latitude\": 134.13413,\n \"longitude\": 757.0435\n },\n \"recipient\": [\n {\n \"name\": {\n \"first\": \"John\",\n \"middle\": \"<string>\",\n \"last\": \"Doe\"\n },\n \"email\": \"support@abc.inc\",\n \"phone\": {\n \"number\": 10612345678,\n \"type\": \"MOBILE\"\n }\n }\n ],\n \"cartons\": [\n {\n \"cartonNum\": \"1\",\n \"cartonType\": \"Package\",\n \"promisedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"estimatedShipDate\": \"2022-05-25T07:58:30.996Z\",\n \"estimatedDeliveryDate\": \"2022-05-26T07:58:30.996Z\",\n \"shipmentMethod\": \"ground\",\n \"shipmentCarrier\": \"FEDEX\",\n \"weight\": \"500 gram\",\n \"trackingNumber\": \"1Z999AA10123456784\",\n \"trackingURL\": \"https://fedex.com/tracking\",\n \"trackingDetails\": [\n {\n \"event\": \"picked up\",\n \"eventId\": \"627963716b19511e8a3a631b\",\n \"timestamp\": \"2019-09-30T07:58:30.996Z\",\n \"shipmentCarrier\": \"FEDEX\",\n \"location\": \"Reno, NV\",\n \"notes\": {}\n }\n ],\n \"items\": [\n {\n \"lineItemId\": \"1\",\n \"itemId\": \"100023\",\n \"sku\": \"SKU0023\",\n \"orderId\": \"317736896\",\n \"orderNumber\": \"507f1f77bcf86cd799439011\",\n \"channelId\": \"12\",\n \"segment\": null,\n \"vendorId\": \"56\",\n \"orderedQuantity\": 2,\n \"shippedQuantity\": 2,\n \"returnQuantity\": 1,\n \"returnAmount\": 10,\n \"fees\": [\n {\n \"type\": \"tax\",\n \"value\": 34.56,\n \"quantity\": 12,\n \"refundAmount\": 10.4\n }\n ],\n \"giftCard\": [\n {\n \"giftCardNum\": \"453456765\",\n \"amount\": 50\n }\n ],\n \"attributes\": {},\n \"uom\": null\n }\n ]\n }\n ],\n \"scratchedItems\": [\n {\n \"lineItemId\": \"2\",\n \"itemId\": \"100043\",\n \"sku\": \"SKU00043\",\n \"quantity\": 1,\n \"reasonCode\": \"<string>\",\n \"subReasonCode\": null,\n \"attributes\": {},\n \"uom\": null\n }\n ],\n \"auditLogs\": [\n {\n \"auditType\": \"create\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"auditTimestamp\": \"2022-05-12T09:24:54.804Z\",\n \"source\": \"POS\",\n \"note\": \"Note\",\n \"attributes\": {},\n \"updatedFields\": [\n {\n \"attributeName\": \"UOM\",\n \"attributeOriginalValue\": \"PK\"\n }\n ]\n }\n ],\n \"attributes\": {}\n}"
response = http.request(request)
puts response.read_body{
"shipmentId": "627963716b19511e8a3a631b",
"shipmentNum": "78974156816152",
"invoiceId": "5674156816152",
"allocationId": "112345678912340",
"orderNumber": [
"112345678912340",
"112345678912340"
],
"poNumber": "1125",
"vendorId": "56",
"statusCode": "SHIPPED",
"type": "STANDARD",
"reshipmentReasonCode": "Order went missing",
"shipDate": "2022-06-06T07:58:30.996Z",
"locationNum": "132412",
"locationType": "DC",
"totalCartons": 2,
"masterTrackingNumber": "TX112345678",
"shipToId": "1",
"shipToAddress": {
"addressLine1": "888 Broadway",
"addressLine2": "505 suite",
"addressLine3": "<string>",
"addressLine4": "<string>",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "1003",
"type": "home",
"latitude": 134.13413,
"longitude": 757.0435
},
"recipient": [
{
"name": {
"first": "John",
"middle": "<string>",
"last": "Doe"
},
"email": "support@abc.inc",
"phone": {
"number": 10612345678,
"type": "MOBILE"
}
}
],
"cartons": [
{
"cartonNum": "1",
"cartonType": "Package",
"promisedDeliveryDate": "2022-05-26T07:58:30.996Z",
"estimatedShipDate": "2022-05-25T07:58:30.996Z",
"estimatedDeliveryDate": "2022-05-26T07:58:30.996Z",
"shipmentMethod": "ground",
"shipmentCarrier": "FEDEX",
"weight": "500 gram",
"trackingNumber": "1Z999AA10123456784",
"trackingURL": "https://fedex.com/tracking",
"trackingDetails": [
{
"event": "picked up",
"eventId": "627963716b19511e8a3a631b",
"timestamp": "2019-09-30T07:58:30.996Z",
"shipmentCarrier": "FEDEX",
"location": "Reno, NV",
"notes": {}
}
],
"items": [
{
"shipmentLineItemId": "607f1f77bcf86cd799439011",
"orderId": "317736896",
"orderNumber": "507f1f77bcf86cd799439011",
"lineItemId": "1",
"itemId": "100023",
"sku": "SKU0023",
"channelId": "12",
"segment": null,
"vendorId": "56",
"orderedQuantity": 2,
"shippedQuantity": 2,
"returnQuantity": 1,
"returnAmount": 10,
"fees": [
{
"type": "tax",
"value": 34.56,
"quantity": 12,
"refundAmount": 10.4
}
],
"giftCard": [
{
"giftCardNum": "453456765",
"amount": 50,
"giftCardStatus": "ACTIVE",
"giftCardActiveRequestDate": "2022-05-26T07:58:30.996Z",
"giftCardActiveDate": "2022-06-26T07:58:30.996Z"
}
],
"attributes": {},
"uom": null
}
]
}
],
"scratchedItems": [
{
"orderId": "507f1f77bcf86cd799439012",
"lineItemId": "2",
"itemId": "100043",
"sku": "SKU00043",
"quantity": 1,
"reasonCode": "<string>",
"subReasonCode": "<string>",
"attributes": {},
"uom": null
}
],
"createdAt": "2022-06-06T07:58:30.996Z",
"updatedAt": "2022-06-06T07:58:30.996Z",
"auditLogs": [
{
"auditType": "create",
"employeeId": "62272e917b12209e68751d94",
"auditTimestamp": "2022-05-12T09:24:54.804Z",
"source": "POS",
"note": "Note",
"attributes": {},
"updatedFields": [
{
"attributeName": "UOM",
"attributeOriginalValue": "PK"
}
]
}
],
"attributes": {}
}{
"message": "Bad Request"
}{
"message": "Object Not Found."
}{
"message": "Internal Server Error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Body
Shipment and reshipment details
Shipment number
"78974156816152"
Allocation ID for an order, generated from allocation service
"112345678912340"
fabric-generated Invoice ID
"5674156816152"
Purchase order number (generally, vendor-generated)
"1125"
Vendor ID
"56"
Shipment status code
SHIPMENT_CREATED, SHIPMENT_CANCELLED, PICKUP_CREATED, PICKUP_COMPLETED, SHIPMENT_RETURN_PENDING, SHIPMENT_RETURN_RECEIVED, SHIPMENT_PARTIALLY_DELIVERED, SHIPMENT_DELIVERED "SHIPMENT_CREATED"
Shipment type
STANDARD, RESHIP, RETURN, SCRATCH, PICKUP "STANDARD"
Reason code for reshipment
"Order went missing"
Shipping time
"2022-06-06T07:58:30.996Z"
Location number from the location service
"132412"
Location type based on location service such as store, distribution center (DC)
"DC"
Total number of cartons
2
Main tracking number, to track fulfillment of all the orders
"TX112345678"
Ship-to ID
"1"
Details of delivery address
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Shipment attributes
Show child attributes
Show child attributes
Response
Ok
Shipment details
24-character fabric-generated unique ID of shipment
"627963716b19511e8a3a631b"
Shipment number (external)
"78974156816152"
fabric-generated Invoice ID
"5674156816152"
Allocation ID for an order, generated from allocation service
"112345678912340"
Order number. It's usually generated by another system, such as an external checkout system.
["112345678912340", "112345678912340"]
Purchase order number (generally, vendor-generated)
"1125"
Vendor ID
"56"
Shipment status code
SHIPMENT_CREATED, SHIPMENT_CANCELLED, PICKUP_CREATED, PICKUP_COMPLETED, SHIPMENT_RETURN_PENDING, SHIPMENT_RETURN_RECEIVED, SHIPMENT_PARTIALLY_DELIVERED, SHIPMENT_DELIVERED "SHIPPED"
shipment type
STANDARD, RESHIP, RETURN, SCRATCH, PICKUP "STANDARD"
Reason code for reshipment
"Order went missing"
Time of shipping
"2022-06-06T07:58:30.996Z"
location number from location service to get exact address.
"132412"
Location type based on location service such as store, distribution center (DC)
"DC"
Total number of cartons
2
Main tracking number, to track fulfillment of all the orders
"TX112345678"
Ship-to ID refers to item's delivery address
"1"
Details of delivery address
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
details of scratched items
Show child attributes
Show child attributes
Time of shipment creation
"2022-06-06T07:58:30.996Z"
Time of last update
"2022-06-06T07:58:30.996Z"
Details of audit logs
Show child attributes
Show child attributes
Attribute details for additional information
Show child attributes
Show child attributes
Was this page helpful?
