NAV Navbar
6096555391
  • Introduction
  • Brahmi
  • Pagination
  • (928) 212-0324
  • Orders
  • Ship Notices
  • Introduction

    Welcome to the Stitch Labs 3PL API. You can use our API to access API endpoints, which can get information on various products and orders in our database.

    The base url for all requests is /integration-fake-3pl.stch.co

    Authentication

    Stitch Labs 3PL uses an account id to allow access to the API. You can register for a new account by contacting (318) 560-0028

    Stitch Labs 3PL expects the Account Id to be included in all API requests to the server in a header that looks like the following:

    X-Account-Id: account-id-here

    Pagination

    All GET list endpoints can be paginated using the following query parameters

    Parameter Description
    page The page number of the paginated resource
    pageSize The number of resources per page. Max limit of 50 per page

    Products

    Product Properties

    Attribute Type Description
    id String Unique id for the resource.
    sku String The sku associated to the resource
    stock Integer The stock quantity available for the resource
    title String The title associated to the resource
    createdAt Date The date time the order was created
    updatedAt Date The date time the order was last update

    Create a Product

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/products/599906c5eca0cc29c1464c45', {
      method: 'POST',
      headers: {
        'X-Account-Id': "12345"
      },
      body: {
        "sku": "123-SKU",
        "stock": 100,
        "title": "Another Test Product",
      }
    })
    

    Response

    {
        "id": "59bae732b2d19361451fc596",
        "createdAt": "2017-09-14T20:31:46.699Z",
        "sku": "123-SKU",
        "stock": 100,
        "title": "Another Test Product",
        "updatedAt": "2017-09-14T20:31:46.699Z"
    }
    

    This endpoint retrieves a specific product.

    HTTP Request

    POST /integration-fake-3pl.stch.co/products

    Get a Specific Product

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/products/599906c5eca0cc29c1464c45', {
      method: 'GET',
      headers: {
        'X-Account-Id': "12345"
      }
    })
    

    Response

    {
        "id": "599906c5eca0cc29c1464c45",
        "createdAt": "2017-08-20T03:49:25.061Z",
        "sku": "TEST-SKU",
        "stock": 79,
        "title": "A Test Product",
        "updatedAt": "2017-09-05T04:22:19.620Z"
    }
    

    This endpoint retrieves a specific product.

    HTTP Request

    GET /integration-fake-3pl.stch.co/products/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the product to retrieve

    Get All Products

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/products', {
      method: 'GET',
      headers: {
        'X-Account-Id': "12345"
      }
    })
    

    Response

    {
        "after": "599906c5eca0cc29c1464c45",
        "before": "599906c5eca0cc29c1464c45",
        "data": [
            {
                "id": "599906c5eca0cc29c1464c45",
                "createdAt": "2017-08-20T03:49:25.061Z",
                "sku": "TEST-SKU",
                "stock": 79,
                "title": "A Test Product",
                "updatedAt": "2017-09-05T04:22:19.620Z"
            }
        ],
        "hasMore": false,
        "links": {
            "first": "/products?page=1&currentPage=1&pageSize=10",
            "last": "/products?page=1&currentPage=1&pageSize=10&last=true"
        },
        "page": 1,
        "pageCount": 1,
        "total": 1
    }
    

    This endpoint retrieves all products.

    HTTP Request

    GET /integration-fake-3pl.stch.co/products

    Orders

    Order Properties

    Attribute Type Description
    id String Unique id for the resource.
    externalId String The id set when creating an order
    lineItems Array The line items on the order
    lineItems.itemId String The product id of the line item
    lineItems.quantity Integer The quantity orderded for the line item
    shipments Array The shipments on the order
    shipments.id String Unique id for the shipment resource
    shipments.trackingCode String The tracking code for the shipment
    shipments.trackingUrl String The tracking url for the shipment
    shipments.lineItems Array The line items for the shipment resource
    shipments.lineItems.itemId String The product id for the line item
    shipments.lineItems.packed Integer The packed quantity for the line item
    status string The status of an order can be 'pending', 'partially shipping' or 'shipped'
    shippingName String The shipping name for the order
    shippingAddressStreet1 String The shipping address for the order
    shippingAddressStreet2 String The shipping address apt/suite number for the order
    shippingAddressCity String The shipping city for the order
    shippingAddressState String The shipping state for the order
    shippingAddressZip String The shipping zip code for the order
    shippingAddressCountryIso String The shipping country iso for the order
    createdAt Date The date time the order was created
    updatedAt Date The date time the order was last update

    Create an Order

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/orders', {
      method: 'POST',
      headers: {
        'X-Account-Id': "12345"
      },
      body: {
        "externalId": "1234567",
        "shippingName": "Zack Rosen",
        "shippingAddressStreet1": "489 Clementina",
        "shippingAddressStreet2": "#307",
        "shippingAddressCity": "San Francisco",
        "shippingAddressState": "CA",
        "shippingAddressZip": "94103",
        "shippingAddressCountryIso": "US",
        "lineItems": [
          {
            "itemId": "59bae732b2d19361451fc596",
            "quantity": 1
          }
        ]
      }
    })
    

    Response

    {
        "id": "59ab8afadcdffb2ce7bf2673",
        "createdAt": "2017-09-03T04:54:18.896Z",
        "externalId": "1234567",
        "lineItems": [
          {
            "itemId": "59bae732b2d19361451fc596",
            "quantity": 1
          }
        ],
        "shipments": [],
        "shippingName": "Zack Rosen",
        "shippingAddressStreet1": "489 Clementina",
        "shippingAddressStreet2": "#307",
        "shippingAddressCity": "San Francisco",
        "shippingAddressState": "CA",
        "shippingAddressZip": "94103",
        "shippingAddressCountryIso": "US",
        "status": "pending"
    }
    

    This endpoint creates an order.

    HTTP Request

    POST /integration-fake-3pl.stch.co/orders

    Get a Specific Order

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/orders/645054', {
      method: 'GET',
      headers: {
        'X-Account-Id': "12345"
      }
    })
    

    Response

    {
        "id": "59ab8afadcdffb2ce7bf2673",
        "createdAt": "2017-09-03T04:54:18.896Z",
        "externalId": "645054",
        "lineItems": [
            {
                "itemId": "599906c5eca0cc29c1464c45",
                "quantity": 25
            }
        ],
        "shipments": [
             {
                "id": "59ab962262a2aa34ff338186",
                "createdAt": "2017-09-03T05:41:54.163Z",
                "fulfillment": "59ab8afadcdffb2ce7bf2673",
                "lineItems": [
                    {
                        "itemId": "599906c5eca0cc29c1464c45",
                        "packed": 25
                    }
                ],
                "trackingCode": "9409400747630599",
                "trackingUrl": "/tools.usps.com/go/TrackConfirmAction.action?tLabels=9.409400747630599e+21",
                "updatedAt": "2017-09-03T05:41:54.163Z"
            }
        ],
        "shippingAddressCity": "San Francisco",
        "shippingAddressCountryIso": "US",
        "shippingAddressState": "CA",
        "shippingAddressStreet1": "489 Clementina",
        "shippingAddressStreet2": "",
        "shippingAddressZip": "94109",
        "shippingName": "Zack Rosen",
        "status": "shipped",
        "updatedAt": "2017-09-03T05:41:54.203Z"
    }
    

    This endpoint retrieves a specific order using the external id that was provided when creating an order.

    HTTP Request

    GET /integration-fake-3pl.stch.co/orders/<ExternalID>

    URL Parameters

    Parameter Description
    ExternalID The External ID of the order to retrieve

    Get All Orders

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/orders', {
      method: 'GET',
      headers: {
        'X-Account-Id': "12345"
      }
    })
    

    Response

    {
        "after": "59ab8afadcdffb2ce7bf2673",
        "before": "59ab8afadcdffb2ce7bf2673",
        "data": [
            {
                "id": "59ab8afadcdffb2ce7bf2673",
                "createdAt": "2017-09-03T04:54:18.896Z",
                "externalId": "645054",
                "lineItems": [
                    {
                        "itemId": "599906c5eca0cc29c1464c45",
                        "quantity": 25
                    }
                ],
                "shipments": [
                     {
                        "id": "59ab962262a2aa34ff338186",
                        "createdAt": "2017-09-03T05:41:54.163Z",
                        "fulfillment": "59ab8afadcdffb2ce7bf2673",
                        "lineItems": [
                            {
                                "itemId": "599906c5eca0cc29c1464c45",
                                "packed": 25
                            }
                        ],
                        "trackingCode": "94094007476305991",
                        "trackingUrl": "/tools.usps.com/go/TrackConfirmAction.action?tLabels=9.409400747630599e+21",
                        "updatedAt": "2017-09-03T05:41:54.163Z"
                    }
                ],
                "shippingAddressCity": "San Francisco",
                "shippingAddressCountryIso": "US",
                "shippingAddressState": "CA",
                "shippingAddressStreet1": "489 Clementina",
                "shippingAddressStreet2": "",
                "shippingAddressZip": "94109",
                "shippingName": "Zack Rosen",
                "status": "shipped",
                "updatedAt": "2017-09-03T05:41:54.203Z"
            }
        ],
        "hasMore": false,
        "links": {
            "first": "/orders?page=1&currentPage=1&pageSize=10",
            "last": "/orders?page=1&currentPage=1&pageSize=10&last=true"
        },
        "page": 1,
        "pageCount": 1,
        "total": 1
    }
    

    This endpoint retrieves all orders.

    HTTP Request

    GET /integration-fake-3pl.stch.co/orders

    Ship Notices

    Ship Notice Properties

    Attribute Type Description
    id String Unique id for the resource.
    externalId String The partner id when creating ship notice
    expectedArrivalDate Date The date when the ship notice is expected to arrive
    expecteShipDate Date The date when the ship notice is expected to ship
    arrivalDate Date The date when the ship notice arrives
    completedAt Date The date when receiving has been compelted
    trackingCode String The tracking code for the ship notice
    status String The status of the ship notice
    lineItems Array The line items on the ship notice
    lineItems.id String The id of the line item
    lineItems.itemId String The product id of the line item
    lineItems.quantity Integer The quantity orderded for the line item
    lineItems.quantityReceived Integer The quantity received for the line item
    createdAt Date The date time the ship notice was created
    updatedAt Date The date time the ship notice was last update

    Create a Ship Notice

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/ship_notices', {
      method: 'POST',
      headers: {
        'X-Account-Id': "12345"
      },
      body: {
        "externalId": "589",
        "expectedShipDate": "2018-02-02T08:00:00.000Z",
        "expectedArrivalDate": "2018-02-03T08:00:00.000Z",
        "trackingCode": "9999999999",
        "lineItems": [
          {
            "id": "5998ad19d9959afaaffa2",
            "quantity": 5,
          }
        ]
      }
    })
    

    Response

    {
      "id": "5998ad19d9959afaaffa1",
      "externalId": "589",
      "status": "pending",
      "expectedShipDate": "2018-02-02T08:00:00.000Z",
      "expectedArrivalDate": "2018-02-03T08:00:00.000Z",
      "arrivalDate": null,
      "completedAt": null,
      "lineItems": [{
        "id": "5998ad19d9959afaaffa2",
        "itemId": "123",
        "quantity": 5,
        "quantityReceived": 0,
      }],
      "createdAt": "2018-02-02T05:00:00.000Z",
      "updatedAt": "2018-02-02T05:00:00.000Z"
    }
    

    This endpoint creates a ship notice.

    HTTP Request

    POST /integration-fake-3pl.stch.co/ship_notices

    Update a Ship Notice

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/ship_notices/5998ad19d9959afaaffa1', {
      method: 'POST',
      headers: {
        'X-Account-Id': "12345"
      },
      body: {
        "externalId": "589",
        "expectedShipDate": "2018-02-02T08:00:00.000Z",
        "expectedArrivalDate": "2018-02-03T08:00:00.000Z",
        "trackingCode": "9999999999",
        "lineItems": [
          {
            "id": "5998ad19d9959afaaffa2",
            "quantity": 5,
          },
          {
            "itemId": "1234",
            "quantity": 10,
          }
        ]
      }
    })
    

    Response

    {
        "id": "5998ad19d9959afaaffa1",
        "externalId": "589",
        "status": "pending",
        "expectedShipDate": "2018-02-02T08:00:00.000Z",
        "expectedArrivalDate": "2018-02-03T08:00:00.000Z",
        "arrivalDate": null,
        "completedAt": null,
        "lineItems": [
            {
              "id": "5998ad19d9959afaaffa2",
              "itemId": "123",
              "quantity": 5,
              "quantityReceived": 0,
            },
            {
              "id": "5938ad2fd9959gfaclma9",
              "itemId": "1234",
              "quantity": 10,
              "quantityReceived": 0,
            }
        ],
        "createdAt": "2018-02-02T05:00:00.000Z",
        "updatedAt": "2018-02-02T05:00:00.000Z"
    }
    

    This endpoint creates a ship notice.

    New lines items are created when an itemId exists without an id.

    Line items are removed when they are not included in an update.

    HTTP Request

    POST /integration-fake-3pl.stch.co/ship_notices/5998ad19d9959afaaffa1

    Get a Specific Ship Notice

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/ship_notices/5998ad19d9959afaaffa1', {
      method: 'GET',
      headers: {
        'X-Account-Id': "12345"
      }
    })
    

    Response

    {
      "id": "5998ad19d9959afaaffa1",
      "externalId": "589",
      "status": "pending",
      "expectedShipDate": "2018-02-02T08:00:00.000Z",
      "expectedArrivalDate": "2018-02-03T08:00:00.000Z",
      "arrivalDate": null,
      "completedAt": null,
      "lineItems": [{
        "id": "5998ad19d9959afaaffa2",
        "itemId": "123",
        "quantity": 5,
        "quantityReceived": 0,
      }],
      "createdAt": "2018-02-02T05:00:00.000Z",
      "updatedAt": "2018-02-02T05:00:00.000Z"
    }
    

    This endpoint retrieves a specific ship notice using the id that was provided when creating a ship notice.

    HTTP Request

    GET /integration-fake-3pl.stch.co/ship_notices/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the ship notice to retrieve

    Get All Ship Notices

    const rp = require('request-promise');
    
    rp('/integration-fake-3pl.stch.co/ship_notices', {
      method: 'GET',
      headers: {
        'X-Account-Id': "12345"
      }
    })
    

    Response

    {
        "after": "59ab8afadcdffb2ce7bf2673",
        "before": "59ab8afadcdffb2ce7bf2673",
        "data": [
            {
              "id": "5998ad19d9959afaaffa1",
              "externalId": "589",
              "status": "pending",
              "expectedShipDate": "2018-02-02T08:00:00.000Z",
              "expectedArrivalDate": "2018-02-03T08:00:00.000Z",
              "arrivalDate": null,
              "completedAt": null,
              "lineItems": [{
                "id": "5998ad19d9959afaaffa2",
                "itemId": "123",
                "quantity": 5,
                "quantityReceived": 0,
              }],
              "createdAt": "2018-02-02T05:00:00.000Z",
              "updatedAt": "2018-02-02T05:00:00.000Z"
            }
        ],
        "hasMore": false,
        "links": {
            "first": "/ship_notices?page=1&currentPage=1&pageSize=10",
            "last": "/ship_notices?page=1&currentPage=1&pageSize=10&last=true"
        },
        "page": 1,
        "pageCount": 1,
        "total": 1
    }
    

    This endpoint retrieves all ship notices.

    HTTP Request

    GET /integration-fake-3pl.stch.co/ship_notices