The Products API provides a simple interface to manage the Product Catalog.

The catalog lists products available in your account. To add products to a deal, you should create an Order, then populate it with Line Items.

The API allows you to create, delete and update your products. You can also retrieve a single product as well as list of all products.

All users can read the Product Catalog, but it can be edited only by an account administrator. However, changes to products can be completely disabled in account's settings. When disabled, all data are preserved and only GET requests are allowed, even for administrators.

Line Items, Products and Orders are available only to users who are on the Enterprise plan.

JSON format

NameRead OnlyTypeDescription
idtruenumberUnique identifier of the product.
nametruestringName of the product.
descriptionfalsestringDescription of the product.
skufalsestringStock Keeping Unit identification code.
activefalsebooleanIndicator of whether the product is active. Line items cannot be created from inactive products.
max_discountfalsenumberMaximum discount that can be applied to the product in percents.
max_markupfalsenumberMaximum markup that can be applied to the product in percents.
costfalsedecimalCost of the product. Visible only to account administrators.
cost_currencyfalsestringCurrency of the product cost, specified in 3-character currency code (ISO4217) format. Visible only to account administrators.
pricestruearrayArray specifying products prices in different currencies.
created_attruestringDate and time that the product was created in UTC (ISO8601 format).
updated_attruestringDate and time of the last update on the product in UTC (ISO8601 format).

Retrieve all products

GET /v2/products

Returns all products from the catalog according to the parameters provided.

Parameters

NameRequiredTypeInDescription
pageoptionalnumberQueryPage number to start from. Page numbering starts at 1, and omitting the page parameter will return the first page.
per_pagefalsenumberQueryNumber of records to return per page. Maximum is 500. Defaults to 25.
sort_byfalsestringQueryA field to sort by. Default ordering is ascending. If you want to change the sort ordering to descending, append :desc to the field e.g. sort_by=value:desc. Possible values: id, updated_at, created_at
idsfalsestringQueryComma-separated list of product IDs to be returned in a request.
namefalsestringQueryName of the product.
skufalsestringQuerySKU of the product.
activefalsebooleanQueryIndicator of whether or not the product is active.

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/products \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "items": [    {      "data": {        "id": 1,        "name": "Enterprise Plan",        "sku": "enterprise-plan",        "description": "Includes more storage options",        "active": true,        "prices": [          {            "amount": "1599.99",            "currency": "USD"          },          {            "amount": "3599.99",            "currency": "PLN"          }        ],        "cost": "999.99",        "cost_currency": "USD",        "max_discount": 15,        "max_markup": null,        "created_at": "2014-08-27T16:32:56Z",        "updated_at": "2014-08-27T17:32:56Z"      },      "meta": {        "type": "product"      }    }  ],  "meta": {    "type": "collection",    "count": 1,    "links": {      "self": "http://api.getbase.com/v2/products?page=1&per_page=25"    }  }}

Create a product

POST /v2/products

Create a new product.

Products can be created only by an account administrator.

Parameters

NameRequiredTypeInDescription
nametruestringBodye.g. Enterprise Plan
skufalsestringBodye.g. enterprise-plan
descriptionfalsestringBodyDescription of the product.
activefalsebooleanBodyWhether the product is active. Defaults to true.
costfalsenumberBodye.g. 1000
cost_currencyfalsestringBodye.g. EUR
max_discountfalsenumberBodyMaximum discount on product. Accepts 0-100 (inclusive). Defaults to 0.
max_markupfalsenumberBodyMaximum markup on product. Minimum is 0. Defaults to 0.
pricestruearrayBodye.g. [{"amount": "1599.99", "currency": "USD"}, {"amount": "3599.99", "currency": "PLN"}]

Allowed for

  • Admins

Using cURL

curl -v -X POST https://api.getbase.com/v2/products \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "name": "Enterprise Plan",    "sku": "enterprise-plan",    "description": "Includes more storage options",    "active": true,    "prices": [      {        "amount": "1599.99",        "currency": "USD"      },      {        "amount": "3599.99",        "currency": "PLN"      }    ],    "cost": "1599.99",    "cost_currency": "USD",    "max_discount": 15  },  "meta": {    "type": "product"  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "updated_at": "2014-08-27T16:32:56Z",    "created_at": "2014-08-27T16:32:56Z",    "active": true,    "name": "Enterprise Plan",    "sku": "enterprise-plan",    "description": "Includes more storage options",    "prices": [      {        "amount": "1599.99",        "currency": "USD"      },      {        "amount": "3599.99",        "currency": "PLN"      }    ],    "max_discount": 15,    "max_markup": null,    "cost": "1599.99",    "cost_currency": "USD"  },  "meta": {    "type": "product"  }}

Retrieve a single product

GET /v2/products/:id

Returns a single product, according to the unique product ID provided. If the specified product does not exist, the request will return an error.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier for the product.

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/products/1 \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "updated_at": "2014-08-27T16:32:56Z",    "created_at": "2014-08-27T16:32:56Z",    "active": true,    "name": "Enterprise Plan",    "sku": "enterprise-plan",    "description": "Includes more storage options",    "prices": [      {        "amount": "1599.99",        "currency": "USD"      },      {        "amount": "3599.99",        "currency": "PLN"      }    ],    "max_discount": 15,    "max_markup": null,    "cost": "1599.99",    "cost_currency": "USD"  },  "meta": {    "type": "product"  }}

Update a product

PUT /v2/products/:id

Updates product information. If the specified product does not exist, the request will return an error.

Products can be modified only by an account administrator.

In order to modify prices used on a record, you need to supply the entire set. prices are replaced every time they are used in a request.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier for the product.
namefalsestringBodyName of the product.
descriptionfalsestringBodyDescription of the product.
skufalsestringBodyStock Keeping Unit identification code.
activefalsebooleanBodyIndicator of whether or not the product can be used in new line items.
max_discountfalsenumberBodyMaximum discount that can be applied to the product in percents.
max_markupfalsenumberBodyMaximum markup that can be applied to the product in percents.
costfalsedecimalBodyCost of the product.
cost_currencyfalsestringBodyCurrency of the product cost, specified in 3-character currency code (ISO4217) format.
pricesfalsearrayBodyArray specifying products prices in different currencies. e.g. [{"currency": "USD", "amount": "1599.99"}, {"currency": "PLN", "amount": "3599.99"}]

Allowed for

  • Agents

Using cURL

curl -v -X PUT https://api.getbase.com/v2/products/1 \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "active": false  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "updated_at": "2014-08-27T16:32:56Z",    "created_at": "2014-08-27T16:32:56Z",    "active": false,    "name": "Enterprise Plan",    "sku": "enterprise-plan",    "description": "Includes more storage options",    "prices": [      {        "amount": "1599.99",        "currency": "USD"      },      {        "amount": "3599.99",        "currency": "PLN"      }    ],    "max_discount": 15,    "max_markup": null,    "cost": "1599.99",    "cost_currency": "USD"  },  "meta": {    "type": "product"  }}

Delete a product

DELETE /v2/products/:id

Delete an existing product from the catalog. Existing orders and line items are not affected. If the specified product does not exist, the request will return an error. This operation cannot be undone.

Products can be removed only by an account administrator.

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier for the product.

Allowed for

  • Agents

Using cURL

curl -v -X DELETE https://api.getbase.com/v2/products/1 \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 204 No Content