List fulfillments or shipments from vendors - Fabric

List fulfillments or shipments from vendors

cURL

curl --request GET \
  --url https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/shipments/ \
  --header 'Authorization: Bearer <token>'

Python

import requests

url = "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/shipments/"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)

JavaScript (Fetch)

const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/shipments/', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://marketplace-api.fabric.inc/v1/retailers/{retailer_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}/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))
}

API Response Example

{
  "count": 600,
  "results": [
    {
      "order_id": 677,
      "id": 767,
      "batch_number": 6,
      "label_reference": "Sample label 123",
      "ordered_at": "2021-09-10T15:24:56Z",
      "customer_order_number": "765637",
      "retailer_order_number": "66367",
      "purchase_order_number": "PO-576",
      "shipping_method": {
        "name": "White Glove Bronze",
        "code": "cory_white_glove",
        "id": 5,
        "type": "ltl (less than truck load)",
        "carrier": {
          "id": 229,
          "name": "Cory Companies",
          "code": "CJCD"
        },
        "generic_shipping_method": {
          "name": "LTL",
          "description": "Less than truckload (LTL)",
          "id": 5,
          "type": "ltl"
        }
      },
      "shipping_account": {
        "nickname": "Hobie FedEx",
        "id": 3,
        "owner": "Sample Owner",
        "carrier": {
          "id": 229,
          "name": "Cory Companies",
          "code": "CJCD"
        },
        "is_first_party_bill": true
      },
      "tracking_number": "1Z9999999999999988",
      "tracking_url": "https://wwwapps.demo.com/WebTracking/track?track=yes&trackNums=1Z9999999999999988",
      "tracking": {
        "picked_up_at": "2022-08-10T15:24:56Z",
        "delivered_at": "2022-09-10T15:24:56Z",
        "tracking_details": [
          {
            "status": "Delivered",
            "status_detail": "Out for delivery",
            "id": 78895456,
            "time": "10-10-2022",
            "country": "USA",
            "state": "New York",
            "city": "New York",
            "postal_code": "123R32"
          }
        ]
      },
      "status": "Shipped",
      "is_acknowledged": true,
      "has_commercial_invoice": true,
      "canceled_at": null,
      "sold_to": {
        "name1": "Demo Brand, Inc",
        "street1": "1332 Hermosa Ave",
        "city": "Hermosa Beach",
        "province": "CA",
        "postal_code": "90254",
        "country": "US",
        "id": 10,
        "type": "residential",
        "name2": null,
        "street2": null,
        "phone1": "3105551212",
        "phone2": "3105551213",
        "fax": null,
        "email": null,
        "federal_tax_id": null
      },
      "ship_to": {
        "name1": "Demo Brand, Inc",
        "street1": "1332 Hermosa Ave",
        "city": "Hermosa Beach",
        "province": "CA",
        "postal_code": "90254",
        "country": "US",
        "id": 10,
        "type": "residential",
        "name2": null,
        "street2": null,
        "phone1": "3105551212",
        "phone2": "3105551213",
        "fax": null,
        "email": null,
        "federal_tax_id": null
      },
      "ship_from": {
        "name1": "Demo Brand, Inc",
        "street1": "1332 Hermosa Ave",
        "city": "Hermosa Beach",
        "province": "CA",
        "postal_code": "90254",
        "country": "US",
        "id": 10,
        "type": "residential",
        "name2": null,
        "street2": null,
        "phone1": "3105551212",
        "phone2": "3105551213",
        "fax": null,
        "email": null,
        "federal_tax_id": null
      },
      "ship_weight": 10,
      "ship_width": 1,
      "ship_length": 1,
      "ship_height": 1,
      "ship_girth": "<string>",
      "ship_volume": 4,
      "valid_packing_slip": true,
      "valid_shipping_label": true,
      "shipping_provider_identifier": "shp_3a61e10243da49ab92f0e3861d5d256b",
      "error_logs": {
        "id": 677,
        "message": "Sample errors to fix",
        "count": 12,
        "created_at": "2022-08-10T15:24:56Z"
      },
      "acknowledged_at": "2022-08-10T15:24:56Z",
      "closed_at": null,
      "delivered_at": "2022-09-10T15:24:56Z",
      "shipped_at": "2022-09-10T15:24:56Z",
      "updated_at": "2022-09-10T15:25:56Z",
      "created_at": "2022-09-10T15:24:56Z",
      "shipment_lines": [
        {
          "id": 1001,
          "order_line_number": "1001",
          "quantity": 1,
          "part": 1,
          "freight_class": 50,
          "updated_at": "2022-09-10T15:24:56Z",
          "variant": {
            "id": 249,
            "name": "Var45",
            "brand": {
              "code": "marla-store",
              "id": 456,
              "name": "Marla Store"
            },
            "identifier": "123-DEF12345",
            "brand_identifier": "HATR",
            "upc": 555555555202,
            "retailer_identifiers": [
              {
                "id": 5642,
                "retailer": {
                  "name": "Demo Retailer",
                  "code": "demo-retailer",
                  "id": 500,
                  "logo_url": "https://images.demo.com/retailers/5ef41f6c-3361-40b7-86ce-ecd79c52e9a2/store/logo-lg.png",
                  "cover_url": "https://images.sampke.com/retailers/5ef41f6c-3361-40b7-86ce-ecd79c52e9a2/store/cover.jpg",
                  "profile_tile_url": "https://images.demo.com/retailers/5ef41f6c-3361-40b7-86ce-ecd79c52e9a2/store/profile-tile.jpg",
                  "joined_at": "2021-08-03T17:24:12Z",
                  "is_rcn_retailer": false,
                  "is_onboarded": false,
                  "platform": "fabric",
                  "requires_subscription": "disabled",
                  "brand_permit_creation_allowed": false,
                  "website": "https://demoabc.com",
                  "status": "active"
                },
                "identifier": "SKU976",
                "name": "Retailer Sample"
              }
            ]
          }
        }
      ],
      "signature": null,
      "brand": {
        "code": "demo-brand",
        "id": 500,
        "name": "Marla Cielo",
        "joined_at": "2022-09-10T15:24:56Z",
        "logo_url": "https://images.revcascade.com/retailers/defaults/logo-lg.png",
        "cover_url": "https://images.revcascade.com/retailers/defaults/cover.png",
        "profile_tile_url": "https://images.revcascade.com/retailers/defaults/profile-tile.png",
        "website": null,
        "is_onboarded": false,
        "is_on_rcn": false,
        "requires_subscription": "enabled",
        "subscription_expires_at": "2024-09-19T13:32:10Z",
        "grace_period_ends_at": "2024-10-26T13:32:10Z",
        "subscription_is_expired": false,
        "subscription_is_on_grace_period": false,
        "subscription_is_delinquent": false,
        "inventory_policy": "managed",
        "status": "active"
      },
      "invoice_number": "RC123456"
    }
  ],
  "next": "https://api.example.org/demo/{retailer_id}/?page=5",
  "previous": "https://api.example.org/demo/{retailer_id}/?page=3"
}

Authorizations