Get shipments for an order - Fabric
Get shipments for an order
cURL
curl --request GET \
--url https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/orders/{id}/shipments/ \
--header 'Authorization: Bearer <token>'
Python
import requests
url = "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/orders/{id}/shipments/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch API)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/orders/{id}/shipments/', 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://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/orders/{id}/shipments/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/orders/{id}/shipments/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Java (Unirest)
HttpResponse<String> response = Unirest.get("https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/orders/{id}/shipments/")
.header("Authorization", "Bearer <token>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/orders/{id}/shipments/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Sample Response
[
{
"purchase_order_number": "PO-45678",
"retailer_order_number": "RET-89012",
"ordered_at": "2024-03-15T08:00:00.000Z",
"id": 12345,
"customer_order_number": "CUST-00123",
"brand_identifier": "BRD-001",
"retailer": "Retailer X",
"brand": "Brand A",
"brands": "Brand A, Brand B",
"connection_id": 101,
"shipping_method": "FedEx Ground",
"requested_shipping_method_id": 5,
"requested_shipping_method": "UPS 2nd Day Air",
"shipment_count": 3,
"invoice_count": 2,
"bill_to": "Acme Corp",
"sold_to": "Acme Corp",
"ship_to": "123 Warehouse Ave",
"ship_from": "456 Supplier Rd",
"return_to": "789 Return Ln",
"allow_shipping_label_generation": true,
"subtotal_charged": "99.99",
"shipping_charged": "10.00",
"is_gift": false,
"gift_fee": "5.00",
"is_replacement": false,
"locale_subtotal_charged": "89.99",
"status": "processing",
"locale_currency": "EUR",
"currency": "USD",
"is_acknowledged": true,
"acknowledged_at": "2024-03-16T08:00:00.000Z",
"fulfill_by": "2024-03-20T00:00:00.000Z",
"fulfilled_at": "2024-03-19T08:00:00.000Z",
"closed_at": "2024-03-21T08:00:00.000Z",
"received_at": "2024-03-22T08:00:00.000Z",
"is_on_hold": false,
"pickup_on": "2024-03-25T00:00:00.000Z",
"on_hold_at": "2024-03-24T08:00:00.000Z",
"on_hold_until": "2024-03-30T00:00:00.000Z",
"backordered_until": "2024-04-01T08:00:00.000Z",
"backorder_acknowledged_at": "2024-03-28T08:00:00.000Z",
"canceled_at": "2024-03-29T08:00:00.000Z",
"updated_at": "2024-04-01T12:00:00.000Z",
"order_lines": "[...]",
"cancels": "[...]",
"shipments": "[...]",
"attachments": "[...]",
"memos": "Memo 1",
"memos_count": 1,
"unread_memos_count": 0,
"tags": "Priority",
"gift_message": "Happy Birthday!",
"fill_time": "48.00",
"invoices": "[...]",
"signature": "required",
"rmas": "[...]",
"credits": "[...]",
"order_batches": "[...]",
"metadata": "[...]",
"connection_shipping_provider_account": "USPS-Conn-01",
"is_priority": true,
"priority_user": "admin@example.com",
"envelopes": "Envelope A",
"platform_account_transactions": "[...]"
}
]
Authorizations
Authorization header of the form Bearer <token> is required.
Path Parameters
retailer_id: The unique retailer ID (required).id: The unique order ID (required).
Response
200 - application/json: Shipments for the order.