NAV Navbar
  • Introduction
  • Authentication
  • Environments
  • Security
  • Token Management
  • Test Environment
  • Managing Product Data
  • Pagination
  • Orders
  • Products
  • Inventory
  • Errors
  • Introduction

    The Endless Aisles Retailer API enables you to view our product catalog and use our dropshipping service to power your business.

    Authentication

    In order to authenticate with the API, you will need an API token. To authenticate a request, you will need to add our custom header to your request, like so:

    X-EA-REQUEST-TOKEN: {Token}

    Environments

    The url for the test enviroment is https://app-qa.endlessaisles.io/. Use this url during development and testing.

    The url for the production environment is https://app.endlessaisles.io/. Do not post test orders to this URL as they will be fufilled.

    Security

    As described in the authentication section, our API endpoints require use of an access token.

    With an access token you will able able to see, modify, or create data for customers, orders, and products that are relevant to your own shop. You will not be able to access the data of a different shop.

    Your tokens must be kept secure. If another party gains access to your token, they will be able to access and modify your data, including placing orders on your behalf. If a token is compromised, you will need to notify us as soon as possible. You should revoke the compromised token immediately using token management tools in Endless Aisles.

    Token Management

    Once you have login credentials for Endless Aisles, you can login and manage your API tokens. Navigate to Admin -> API Keys in the sidebar to view your token management tools. These tools are available in both the test and production environment.

    You will be able to create new tokens and revoke existing ones. Please be aware that when you create a new token, it will show you the token once and only once. If you fail to copy and store the token, you should revoke the newly created token and generate a new one.

    Test Environment

    All development should be done using our test environment.

    Our test database refreshes daily, so upon placing orders in test, part of the order data will be wiped out the next day. You will encounter 404's when trying to view past order details for orders older than a day. This is expected behavior and you should place a new order while testing.

    Inventory is not automatically deducted when placing orders in test. This is because orders are not fulfilled by any automatic processes within the test environment. If you need to test this behavior, you'll need to contact us in order to have someone manually fulfill the orders in our test environment, so that you can test the process with inventory being deducted as expected.

    Managing Product Data

    If you require pulling our product data into your system, we recommend doing an initial pull of all our product data and then updating this data every 24 hours. This will help ensure that you have the most update product metadata.

    Pagination

    Our API GET endpoints utilize pagination. You may pass URL parameters to these endpoints to navigate the pagination.

    Parameter Default Description
    page 10 Number of page.
    per_page 10 Number of results you'll get back per page.

    Orders

    GET /orders

    This endpoint allows you to retrieve a list of orders, based on based on recency or an optional provided search query param.

    Sample of returned JSON:

    {
      "current_page": 2,
      "data": [
        {
          "id": 10002,
          "status": "Scheduled",
          "customer": {
            "email": "slow@poke.com"
          },
          "shipping": {
            "id": 3,
            "first_name": "Slow",
            "last_name": "Poke",
            "line_1": "Slow Pole",
            "line_2": "Poke City",
            "city": "Poke",
            "zip": "10001",
            "state": "NY",
            "phone": "7897897897",
            "created_at": "2018-03-23 14:35:50",
            "updated_at": "2018-03-23 14:35:50",
            "full_name": "Slow Poke"
          },
          "wholesale": 8.82,
          "freight": 7.52,
          "pick_pack": 2,
          "margin": 5.64,
          "total": 26.11,
          "created_at": "03-23-2018"
        },
        {
          "id": 10001,
          "status": "Scheduled",
          "customer": {
            "email": "cats@dogs.com"
          },
          "shipping": {
            "id": 2,
            "first_name": "Cat",
            "last_name": "Dog",
            "line_1": "789",
            "line_2": "Ny",
            "city": "Nyc",
            "zip": "10033",
            "state": "NY",
            "phone": "7897897897",
            "created_at": "2018-03-22 16:30:52",
            "updated_at": "2018-03-22 16:30:52",
            "full_name": "Cat Dog"
          },
          "wholesale": 17.29,
          "freight": 7.52,
          "pick_pack": 2,
          "margin": 8.17,
          "total": 38.08,
          "created_at": "03-22-2018"
        },
        {
          "id": 10000,
          "status": "Scheduled",
          "customer": {
            "email": "ele@phants.com"
          },
          "shipping": {
            "id": 1,
            "first_name": "Ele",
            "last_name": "Phant",
            "line_1": "Ele",
            "line_2": "Ele",
            "city": "Ele",
            "zip": "10001",
            "state": "NY",
            "phone": "1234567890",
            "created_at": "2018-03-09 22:21:48",
            "updated_at": "2018-03-09 22:21:48",
            "full_name": "Ele Phant"
          },
          "wholesale": 15.96,
          "freight": 7.52,
          "pick_pack": 2,
          "margin": 7.5,
          "total": 35.91,
          "created_at": "03-09-2018"
        }
      ],
      "first_page_url": "/?page=1",
      "from": 11,
      "last_page": 2,
      "last_page_url": "/?page=2",
      "next_page_url": null,
      "path": "/",
      "per_page": 10,
      "prev_page_url": "/?page=1",
      "to": 13,
      "total": 13
    }
    

    HTTP Request

    GET /api/orders

    e.g. /api/orders?page=2

    For information about the pagination on this endpoint, see pagination section above.

    URL Query Parameters

    Parameter Default Description
    query null Optional. If an email address, will search for orders for a particular email address. If numeric, will attempt to lookup by order number. If is a string, will attempt to look up by customer's last name.
    since null Optional. Orders created since this date. Format: m-d-Y. If format is wrong, is ignored.
    status null Optional. Either open (PENDING or SCHEDULED) or closed (SHIPPED, CANCELED, or FAILED)
    page 1 Optional. Number of page.
    per_page 10 Optional. Orders per page.

    HTTP Response Codes

    GET /orders/{id}

    This endpoint retrieves data about a specific order.

    Sample of returned JSON for order that has not shipped:

    {
      "data": {
        "id": 10028,
        "status": "Scheduled",
        "customer": {
          "email": "cardi@b.com"
        },
        "line_items": [
          {
            "id": 22397,
            "product_id": 12209,
            "upc": "074198609628",
            "quantity": 1,
            "quantity_shipped": null,
            "price": 13.99,
            "margin": 5.17,
            "wholesale": 8.82,
            "tax": 1.24,
            "discount": 0,
            "is_shipping": false,
            "title": "Taste Of The Wild High Prairie Dry Dog Food",
            "image": "stage-img.petflow.com/images/default/products/large/12209-10.jpg",
            "size": "5-lb",
            "sizes": [
              {
                "id": 22397,
                "upc": "074198609628",
                "price": 13.99,
                "name": "5-lb",
                "wholesale": 8.82,
                "purchasability": true,
                "shipping_weight_lbs": 5
              },
              {
                "id": 22398,
                "upc": "074198609635",
                "price": 29.99,
                "name": "15-lb",
                "wholesale": 21.67,
                "purchasability": true,
                "shipping_weight_lbs": 15
              },
              {
                "id": 22399,
                "upc": "074198609642",
                "price": 48.99,
                "name": "30-lb",
                "wholesale": 37.2,
                "purchasability": true,
                "shipping_weight_lbs": 30
              }
            ],
            "metadata": {
              "species": "Dog",
              "category": "Food",
              "life_stage": ["All Stages"],
              "product_group": [],
              "main_ingredient": "Beef",
              "breed_size": ["All Breeds"],
              "special_condition": ["Grain-Free"],
              "subcategory": "Dry Food",
              "type": [],
              "country_of_origin": "UNITED STATES"
            },
            "brand": "Taste Of The Wild"
          },
          {
            "id": 1,
            "product_id": 1,
            "upc": null,
            "quantity": 1,
            "price": 9.99,
            "margin": 0,
            "wholesale": 0,
            "tax": 0.89,
            "discount": 0,
            "is_shipping": true
          }
        ],
        "shipping": {
          "id": 23,
          "first_name": "Cardi",
          "last_name": "B",
          "line_1": "Cat",
          "line_2": "Cardi",
          "city": "Cat",
          "zip": "10001",
          "state": "NY",
          "phone": "7897897897",
          "created_at": "2018-04-19 17:28:29",
          "updated_at": "2018-04-19 17:28:29",
          "full_name": "Cardi B"
        },
        "wholesale": 8.82,
        "freight": 7.52,
        "pick_pack": 2,
        "margin": 5.64,
        "shipping_cost": 9.99,
        "discount": 0,
        "subtotal": 13.99,
        "tax": 2.13,
        "total": 26.11,
        "created_at": "04-19-2018",
        "ship_date": "2018-04-19",
        "placed_on": "2018-04-19",
        "shipments": [],
        "last_updated": "2018-04-19 17:25:15"
      }
    }
    

    Sample of returned JSON for an order that has shipped:

    {
      "data": {
        "id": 13560,
        "status": "Shipped",
        "customer": {
          "email": "test.user@phido.io"
        },
        "line_items": [
          {
            "id": 43308,
            "product_id": 39957,
            "upc": "655199036110",
            "quantity": 1,
            "quantity_shipped": 1,
            "price": 0.89,
            "margin": -22.05,
            "wholesale": 22.05,
            "tax": 0,
            "discount": 0.89,
            "is_shipping": false,
            "title": "K&H Pet Products Self Warming Nuzzle Nest Pet Bed",
            "image": "img.petflow.com/images/default/products/large/39957-1477899491.jpg",
            "size": "Leopard, 19\" x 19\" x 6\"",
            "sizes": [
              {
                "id": 43308,
                "upc": "655199036110",
                "price": 26.28,
                "name": "Leopard, 19\" x 19\" x 6\"",
                "wholesale": 22.05,
                "purchasability": false,
                "shipping_weight_lbs": 10
              }
            ],
            "metadata": {
              "species": "Dog & Cat",
              "category": "Beds, Crates & Gates",
              "life_stage": ["All Stages"],
              "product_group": ["Beds"],
              "main_ingredient": null,
              "breed_size": ["All Breeds"],
              "special_condition": [],
              "subcategory": null,
              "type": [],
              "country_of_origin": null
            },
            "brand": "K&H Pet Products"
          },
          {
            "id": 1,
            "product_id": 1,
            "upc": null,
            "quantity": 1,
            "price": 5.95,
            "margin": 0,
            "wholesale": 0,
            "tax": 0,
            "discount": 5.95,
            "is_shipping": true
          }
        ],
        "shipping": {
          "id": 3319,
          "first_name": "Test",
          "last_name": "User",
          "line_1": "989 6th Ave., 12th Fl.",
          "line_2": "",
          "city": "New York",
          "zip": "10018",
          "state": "NY",
          "phone": null,
          "created_at": "2018-01-31 20:04:20",
          "updated_at": "2018-01-31 20:04:20",
          "full_name": "Test User"
        },
        "wholesale": 22.05,
        "freight": 7.51,
        "pick_pack": 2,
        "margin": -31.57,
        "shipping_cost": 5.95,
        "discount": 6.83,
        "subtotal": 0.89,
        "tax": 0,
        "total": 0,
        "created_at": "01-31-2018",
        "ship_date": "2018-01-31",
        "placed_on": "2018-01-31",
        "shipments": [
          {
            "url": "https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=123456789012&cntry_code=us",
            "number": "123456789012"
          }
        ],
        "last_updated": "2018-02-01 09:50:07"
      }
    }
    

    HTTP Request

    GET /api/orders/{id}

    e.g. /api/orders/10015

    URL Parameters

    Parameter Description
    ID ID of the order to retrieve

    HTTP Response Codes

    PUT /orders

    Sample payload to create an order:

    {
      "shipping": {
        "address_line_1": "123 Anyplace St",
        "address_line_2": "Unit 3",
        "city": "Hyrule",
        "first_name": "Test",
        "last_name": "Customer",
        "state": "NC",
        "zip": "27511"
      },
      "line_items": [
        {
          "id": 42117,
          "upc": "064992103132",
          "quantity": 1,
          "price": 25.0
        }
      ]
    }
    

    Sample of returned JSON:

    {
      "data": {
        "id": 10030,
        "status": "Scheduled",
        "customer": {
          "email": "testcustomer@website.com"
        },
        "line_items": [
          {
            "id": 39824,
            "product_id": 29492,
            "upc": "23423423",
            "quantity": 1,
            "quantity_shipped": 0,
            "price": 25,
            "margin": 5,
            "wholesale": 20,
            "tax": 0,
            "discount": 0,
            "is_shipping": false
          }
        ],
        "shipping": {
          "city": "Hyrule",
          "first_name": "Test",
          "last_name": "Customer",
          "phone": "5555555555",
          "state": "NC",
          "zip": "27511",
          "line_1": "123 Anyplace St",
          "line_2": "Unit 3",
          "updated_at": "2018-04-20 15:04:45",
          "created_at": "2018-04-20 15:04:45",
          "id": 24,
          "full_name": "Test Customer"
        },
        "wholesale": 20,
        "freight": 2,
        "pick_pack": 0,
        "margin": 3,
        "shipping_cost": 0,
        "discount": 0,
        "subtotal": 25,
        "tax": 0,
        "total": 25,
        "created_at": "04-20-2018"
      }
    }
    

    This endpoint allows you to place an order.

    HTTP Request

    PUT /api/orders

    Sample Payload

    This endpoint requires a payload that includes information for the order. View a sample payload on the right.

    Validations and Formatting

    Parameter Request Validation Rules
    shipping.first_name Required. String
    shipping.last_name Required. String
    shipping.phone Optional. String
    shipping.address_line_1 Required. String
    shipping.address_line_2 Optional. String
    shipping.city Required. String
    shipping.state Required. String, max length: 2
    shipping.zip Required. String
    shipping.country Optional. String
    customer.email Optional. Email
    line_items.*.upc Required. Numeric
    line_items.*.id Required. Numeric
    line_items.*.price Required. Numeric
    line_items.*.quantity Required. Numeric
    tax_rate Optional. Numeric
    shipping_cost Optional. Numeric
    discount Optional. Numeric
    custom_order_id Optional. String

    HTTP Response Codes

    PUT /orders/{id}/cancel

    This endpoint allows you to cancel a recently placed order. An order can only be cancelled up until the point where it is packed at warehouse. This is typically within 30 minutes of ordering during business hours.

    HTTP Request

    GET /api/orders/{id}/cancel

    e.g /api/orders/12345/cancel

    HTTP Response Codes

    Products

    GET /products

    This endpoint allows you to retrieve a list of products based on a provided search term.

    Sample of returned JSON:

    {
        "current_page": 1,
        "data": [
            {
                "id": 32154,
                "title": "Phundamental Puppy Phood",
                "brand": "PHIDO",
                "description": "Phundamental Puppy Phood is fundamental food for your puppy! It's got what pups crave.",
                "ingredients": "Electrolytes, chicken, lean turkey, lean beef, tri-tip, fish cheek, turnips",
                "analysis": [
                    {
                        "nutrient": "Electrolytes",
                        "guaranteed_units": "99% min"
                    },
                    {
                        "nutrient": "Chicken Giblets",
                        "guaranteed_units": "18% min"
                    },
                    {
                        "nutrient": "Refined Fiber",
                        "guaranteed_units": "4% max"
                    },
                    {
                        "nutrient": "Moisture",
                        "guaranteed_units": "12% max"
                    },
                    {
                        "nutrient": "Flavor",
                        "guaranteed_units": "1.2% min"
                    },
                    {
                        "nutrient": "Odor",
                        "guaranteed_units": "0.9% min"
                    },
                    {
                        "nutrient": "Gamma Rays",
                        "guaranteed_units": "3.3% min"
                    },
                    {
                        "nutrient": "Alpha-6 Lean Acids",
                        "guaranteed_units": "0.8% min"
                    },
                ],
                "image_url": "https://image.hosting.net/images/products/321454-1.jpg",
                "additional_image_urls": [
                    "https://image.hosting.net/images/products/321454-2.jpg"
                ],
                "metadata": {
                    "species": "Dog",
                    "category": "Food",
                    "life_stage": [
                        "Puppy"
                    ],
                    "product_group": [],
                    "main_ingredient": "Electrolytes",
                    "breed_size": [
                        "All Breeds"
                    ],
                    "special_condition": [
                        "Grain-Free",
                        "Corn-Free",
                        "No Corn No Wheat No Soy"
                    ],
                    "subcategory": "Dry Food",
                    "type": [],
                    "country_of_origin": "UNITED STATES"
                },
                "sizes": [
                    {
                        "id": 66543,
                        "upc": "1877527745411",
                        "description": "1-lb",
                        "price": 12.99,
                        "wholesale": 3.57,
                        "purchasability": true,
                        "discontinued": false,
                        "minimum_advertised_price": 9.99,
                        "wholesale_source": "endless_aisles",
                        "msrp": "9.99",
                        "shipping_weight_lbs": 4.5,
                        "phillips_item_number": "998442"
                    },
                    {
                        "id": 66542,
                        "upc": "1877527745422",
                        "description": "23-lb",
                        "price": 29.99,
                        "wholesale": 17.13,
                        "purchasability": true,
                        "discontinued": false,
                        "minimum_advertised_price": 19.99,
                        "wholesale_source": "endless_aisles",
                        "msrp": "29.99",
                        "shipping_weight_lbs": 13,
                        "phillips_item_number": "998443"
                    },
                    {
                        "id": 66541,
                        "upc": "1877527745433",
                        "description": "75-lb",
                        "price": 182.99,
                        "wholesale": 61.85,
                        "purchasability": true,
                        "discontinued": false,
                        "minimum_advertised_price": 92.99,
                        "wholesale_source": "endless_aisles",
                        "msrp": "92.99",
                        "shipping_weight_lbs": 25,
                        "phillips_item_number": "998444"
                    }
                ]
            }
        ],
        "from": 1,
        "last_page": 3,
        "next_page_url": "\/?page=2",
        "path": "\/",
        "per_page": 10,
        "prev_page_url": null,
        "to": 10,
        "total": 27
    }
    

    HTTP Request

    GET /api/products

    e.g /api/products/search?term=bully+sticks

    For information about the pagination on this endpoint, see pagination section above.

    URL Query Parameters

    Parameter Default Description
    term null Optional. Product search term.
    sort null Optional. asc (ascending) or desc (descending).
    page 1 Optional. Number of page.
    per_page 10 Optional. Products per page.

    HTTP Response Codes

    GET /products/{id}

    Sample of returned JSON:

    {
        "data": {
            "id": 32154,
            "title": "Phundamental Puppy Phood",
            "brand": "PHIDO",
            "description": "Phundamental Puppy Phood is fundamental food for your puppy! It's got what pups crave.",
            "ingredients": "Electrolytes, chicken, lean turkey, lean beef, tri-tip, fish cheek, turnips",
            "analysis": [
                {
                    "nutrient": "Electrolytes",
                    "guaranteed_units": "99% min"
                },
                {
                    "nutrient": "Chicken Giblets",
                    "guaranteed_units": "18% min"
                },
                {
                    "nutrient": "Refined Fiber",
                    "guaranteed_units": "4% max"
                },
                {
                    "nutrient": "Moisture",
                    "guaranteed_units": "12% max"
                },
                {
                    "nutrient": "Flavor",
                    "guaranteed_units": "1.2% min"
                },
                {
                    "nutrient": "Odor",
                    "guaranteed_units": "0.9% min"
                },
                {
                    "nutrient": "Gamma Rays",
                    "guaranteed_units": "3.3% min"
                },
                {
                    "nutrient": "Alpha-6 Lean Acids",
                    "guaranteed_units": "0.8% min"
                },
            ],
            "image_url": "https://image.hosting.net/images/products/321454-1.jpg",
            "additional_image_urls": [
                "https://image.hosting.net/images/products/321454-2.jpg"
            ],
            "metadata": {
                "species": "Dog",
                "category": "Food",
                "life_stage": [
                    "Puppy"
                ],
                "product_group": [],
                "main_ingredient": "Electrolytes",
                "breed_size": [
                    "All Breeds"
                ],
                "special_condition": [
                    "Grain-Free",
                    "Corn-Free",
                    "No Corn No Wheat No Soy"
                ],
                "subcategory": "Dry Food",
                "type": [],
                "country_of_origin": "UNITED STATES"
            },
            "sizes": [
                {
                    "id": 66543,
                    "upc": "1877527745411",
                    "description": "1-lb",
                    "price": 12.99,
                    "wholesale": 3.57,
                    "purchasability": true,
                    "discontinued": false,
                    "minimum_advertised_price": 9.99,
                    "wholesale_source": "endless_aisles",
                    "msrp": "9.99",
                    "shipping_weight_lbs": 4.5,
                    "phillips_item_number": "998442"
                },
                {
                    "id": 66542,
                    "upc": "1877527745422",
                    "description": "23-lb",
                    "price": 29.99,
                    "wholesale": 17.13,
                    "purchasability": true,
                    "discontinued": false,
                    "minimum_advertised_price": 19.99,
                    "wholesale_source": "endless_aisles",
                    "msrp": "29.99",
                    "shipping_weight_lbs": 13,
                    "phillips_item_number": "998443"
                },
                {
                    "id": 66541,
                    "upc": "1877527745433",
                    "description": "75-lb",
                    "price": 182.99,
                    "wholesale": 61.85,
                    "purchasability": true,
                    "discontinued": false,
                    "minimum_advertised_price": 92.99,
                    "wholesale_source": "endless_aisles",
                    "msrp": "92.99",
                    "shipping_weight_lbs": 25,
                    "phillips_item_number": "998444"
                }
            ]
        }
    }
    

    This endpoint provides detailed information about a single product.

    HTTP Request

    GET /api/products/{id}

    e.g. api/products/28652

    HTTP Response Codes

    GET /products/bysize/{optionId}

    Sample of returned JSON:

    {
        "data": {
            "id": 32154,
            "title": "Phundamental Puppy Phood",
            "brand": "PHIDO",
            "description": "Phundamental Puppy Phood is fundamental food for your puppy! It's got what pups crave.",
            "ingredients": "Electrolytes, chicken, lean turkey, lean beef, tri-tip, fish cheek, turnips",
            "analysis": [
                {
                    "nutrient": "Electrolytes",
                    "guaranteed_units": "99% min"
                },
                {
                    "nutrient": "Chicken Giblets",
                    "guaranteed_units": "18% min"
                },
                {
                    "nutrient": "Refined Fiber",
                    "guaranteed_units": "4% max"
                },
                {
                    "nutrient": "Moisture",
                    "guaranteed_units": "12% max"
                },
                {
                    "nutrient": "Flavor",
                    "guaranteed_units": "1.2% min"
                },
                {
                    "nutrient": "Odor",
                    "guaranteed_units": "0.9% min"
                },
                {
                    "nutrient": "Gamma Rays",
                    "guaranteed_units": "3.3% min"
                },
                {
                    "nutrient": "Alpha-6 Lean Acids",
                    "guaranteed_units": "0.8% min"
                },
            ],
            "image_url": "https://image.hosting.net/images/products/321454-1.jpg",
            "additional_image_urls": [
                "https://image.hosting.net/images/products/321454-2.jpg"
            ],
            "metadata": {
                "species": "Dog",
                "category": "Food",
                "life_stage": [
                    "Puppy"
                ],
                "product_group": [],
                "main_ingredient": "Electrolytes",
                "breed_size": [
                    "All Breeds"
                ],
                "special_condition": [
                    "Grain-Free",
                    "Corn-Free",
                    "No Corn No Wheat No Soy"
                ],
                "subcategory": "Dry Food",
                "type": [],
                "country_of_origin": "UNITED STATES"
            },
            "sizes": [
                {
                    "id": 66543,
                    "upc": "1877527745411",
                    "description": "1-lb",
                    "price": 12.99,
                    "wholesale": 3.57,
                    "purchasability": true,
                    "discontinued": false,
                    "minimum_advertised_price": 9.99,
                    "wholesale_source": "endless_aisles",
                    "msrp": "9.99",
                    "shipping_weight_lbs": 4.5,
                    "phillips_item_number": "998442"
                },
                {
                    "id": 66542,
                    "upc": "1877527745422",
                    "description": "23-lb",
                    "price": 29.99,
                    "wholesale": 17.13,
                    "purchasability": true,
                    "discontinued": false,
                    "minimum_advertised_price": 19.99,
                    "wholesale_source": "endless_aisles",
                    "msrp": "29.99",
                    "shipping_weight_lbs": 13,
                    "phillips_item_number": "998443"
                },
                {
                    "id": 66541,
                    "upc": "1877527745433",
                    "description": "75-lb",
                    "price": 182.99,
                    "wholesale": 61.85,
                    "purchasability": true,
                    "discontinued": false,
                    "minimum_advertised_price": 92.99,
                    "wholesale_source": "endless_aisles",
                    "msrp": "92.99",
                    "shipping_weight_lbs": 25,
                    "phillips_item_number": "998444"
                }
            ]
        }
    }
    

    This endpoint provides detailed information about a single product, searching by the id (also called sku) of one of the product's sizes (also called options).

    HTTP Request

    GET /api/products/bysize/{id}

    e.g. api/products/bysize/42116

    HTTP Response Codes

    GET /products/{productId}/options/{optionId}

    Sample of returned JSON:

    {
        "data": {
            "sku": 66541,
            "upc": "'1877527745433",
            "brand": "PHIDO",
            "category": "Food",
            "species": "Dog",
            "title": "Phundamental Puppy Phood",
            "size": "1-lb",
            "retail": 9.99,
            "minimum_advertised_price": 9.99,
            "wholesale": 3.57,
            "product_id": 32154
        }
    }
    

    Sample of product or product option ID not found:

    {
        "error": "A product option with that id does not exist."
    }
    

    This endpoint provides detailed information about a single product option. A product option is a variant of a product that specifies the size or color or quantity, etc. Product options are also called sizes. The sizes returned from /products/{id} are all product options. The terms SKU, product option id, and size id are used interchangeably.

    HTTP Request

    GET /api/products/{productId}/options/{optionId}

    e.g. api/products/39286/options/42116

    HTTP Response Codes

    Inventory

    GET /stock

    This endpoint provides information about the amount of avaliable stock for one item, a specific list of items, or all items. To retrieve the avaliable stock for all items, make a GET request to /api/stock with no url parameters.

    Sample of returned JSON:

    {
        "data": {
            "24752": 149,
            "24751": 74,
            "24750": 104
        }
    }
    

    Sample of returned JSON for non-entitled product (always returns zero):

    {
        "data": {
            "24999": 0
        }
    }
    

    Sample of returned JSON for product not found (returns empty):

    {
        "data": []
    }
    

    HTTP Request

    GET /api/stock

    e.g /api/stock?sku=24752,24751,24750

    URL Query Parameters

    Parameter Description
    sku Optional. Either one item ID or a list of comma seperate item IDs, refered to as SKUs. If no ID is provided, will return the inventory of all items.

    HTTP Response Codes

    Errors

    Error Messaging

    API errors will be returned as JSON. You'll recieve an error message and, if applicable, a validation message regarding your request. The sample JSON included is the return of a malformed PUT /orders request.

    Sample of returned JSON:

    {
        "error":" [\"The pick pack field is required.\",\"The freight field is required.\"]"
    }