Distribution API

Introduction

API Endpoint:

https://distribution-api.storekit.com/

Welcome to the StoreKit distribution API! You can use this API to view our available products, place and manage order requests.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "https://distribution-api.storekit.com/"
  -H "Authorization: Key exampleibNgJk3EEJ"

Make sure to replace exampleibNgJk3EEJ with your API key.

The distribution API uses API keys to allow access to the API. API keys are available by request only - apply here: https://forms.gle/hp3mg9jFoVk1DpLX8

The distribution API expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Key exampleibNgJk3EEJ

Products

The products API allows you to view all available products.

Product properties

Attribute Type Description
id integer Unique identifier for the resource.
sku string Unique identifier.
name string Product name.
inventory string Stock status. Options: inStock, outOfStock.
price integer Your current product price.

Get all products

curl "https://distribution-api.storekit.com/products/"
  -H "Authorization: Key exampleibNgJk3EEJ"

JSON response example:

[
    {
        "id": 1,
        "sku": "39472390",
        "name": "Star TSP143IIIU USB iOS Printer",
        "inventory": "inStock",
        "price": 14900
    },
    {
        "id": 2,
        "sku": "39472490",
        "name": "Star TSP143IIIU USB iOS Printer",
        "inventory": "inStock",
        "price": 14900
    },
    {
        "id": 3,
        "sku": "AC4076-1538",
        "name": "Socket Mobile Charging Stand",
        "inventory": "inStock",
        "price": 9900
    },
    {
        "id": 4,
        "sku": "AC4133-1871",
        "name": "Socket Mobile Charging Dock",
        "inventory": "inStock",
        "price": 5900
    }
]

This endpoint retrieves all available products.

HTTP Request

GET https://distribution-api.storekit.com/products

Query Parameters

None yet

Retrieve a specific product


curl "https://distribution-api.storekit.com/products/3"
  -H "Authorization: Key exampleibNgJk3EEJ"

JSON response example:

{
  "id": 3,
  "sku": "AC4076-1538",
  "name": "Socket Mobile Charging Stand",
  "inventory": "inStock",
  "price": 9900
}

This endpoint retrieves a specific product by ID.

HTTP Request

GET https://distribution-api.storekit.com/products/<ID>

URL Parameters

Parameter Description
ID The ID of the product to retrieve

Orders

The orders API allows you to view your previous orders including current status, and create new order requests.

Order properties

Attribute Type Description
id integer Unique identifier for the resource.
referenceNumber string Your reference number for the order.
status string Order status. Options: pending, partially shipped, shipped, invoiced
lines array Line items data. See Order - Line items properties
address object Shipping address. See Order - Address properties
shipments array Shipments. See Order - Shipments properties

Order - Address properties

Attribute Type Required Description
firstName string yes First name.
lastName string yes Last name.
companyName string no Company name
phoneNumber string yes Line Phone number
lineOne string yes Address line 1.
lineTwo string no Address line 2.
city string yes City name.
postalCode string yes Postal code.
country string yes Country code in ISO 3166-1 alpha-2 format.
notes string no Order notes

Order - Line item properties

Attribute Type Description
productId integer Unique identifier for the product.
quantity integer Quantity ordered.

Order - Shipments properties

Attribute Type Description
trackingId string Tracking number.
carrier string Shipment courier name.

List all orders

This endpoint retrieves all previous orders.

HTTP Request

GET https://distribution-api.storekit.com/orders

Retrieve a specific order

This endpoint retrieves a specific order.

HTTP Request

GET https://distribution-api.storekit.com/orders/<ID>

URL Parameters

Parameter Description
ID The ID of the order to retrieve

Create an order

Placing a new order:

curl -X POST https://distribution-api.storekit.com/orders \
    -H "Authorization: Key exampleibNgJk3EEJ" \
    -H "Content-Type: application/json" \
    -d '{
  "address": {
    "firstName": "John",
    "lastName": "Doe",
    "lineOne": "54 Broadwick St",
    "lineTwo": "",
    "companyName": "StoreKit Ltd"
    "city": "London",
    "postalCode": "W1F 7AH",
    "country": "UK",
    "phoneNumber": "02033182745"
  },
  "lines": [
    {
      "productId": 93,
      "quantity": 2
    },
    {
      "productId": 22,
      "quantity": 1
    }
  ]
}'

JSON response example:

{
    "id": 4,
    "lines": [
        {
            "price": 14900,
            "quantity": 1,
            "productId": 93
        },
        {
            "price": 5900,
            "quantity": 2,
            "productId": 22
        }
    ],
    "address": {
        "firstName": "John",
        "lastName": "Doe",
        "lineOne": "54 Broadwick St",
        "lineTwo": "",
        "companyName": "StoreKit Ltd",
        "city": "London",
        "postalCode": "W1F 7AH",
        "country": "UK",
        "phoneNumber": "02033182745"
    },
    "referenceNumber": "123XYZ",
    "shipments": [],
    "status": "received",
    "totalPrice": 20800
}

This API helps you to create a new order.

HTTP Request

PUT https://distribution-api.storekit.com/orders/

Status Codes

The API uses the following status codes:

Error Code Meaning
200 OK -- Successful request.
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong or missing.
404 Not Found -- The specified resource could not be found.
429 Too Many Requests -- You're requesting too many times, slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.
Last Updated: 7/18/2019, 11:52:32 AM