A stock supplier is a wholesaler whose warehouse stock can be sourced for the products you sell.

Suppliers are configured by the platform, not by your account: the same set is visible to every account, and enabledForAccount tells you which of them your account may source from. Each supplier publishes availability for the stock items it has been mapped to, and the availability endpoint answers how many units of a given set of stock items that one supplier currently reports.

GET /accounts/{accountId}/stockSuppliers

Get the stock suppliers. The suppliers are configured platform-wide rather than per account, so the same records are returned whichever account is named in the path; enabledForAccount is the per-account part of a record and is true when that account may source from the supplier. Records are named stockSupplier inside the paged envelope.

Parameters
Name In Default Constraints Description
x-auth-token header     The authentication token
accountId required path   int the unique identifier of the account whose access is reported in enabledForAccount
filterId query   optional id of a stored filter (see the Filter resource) to narrow the result
page query 0 int zero-based page index
size query 10 int number of items per page
Response Codes
Code Condition
200 the page of suppliers was returned
Response Body
Media Type Data Type Description
application/json PagedData
application/xml PagedData
Response (XML)
<pagedData>
  <records>...</records>
  <totalElements>...</totalElements>
</pagedData>
Response (JSON)
{
  "pagedData" : {
    "records" : [ { }, { } ],
    "totalElements" : 12345
  }
}
GET /accounts/{accountId}/stockSuppliers/{supplierId}

Get a single stock supplier by its id. Returns the same record the list endpoint returns, enabledForAccount included.

Parameters
Name In Default Constraints Description
x-auth-token header     The authentication token
accountId required path   int the unique identifier of the account whose access is reported in enabledForAccount
supplierId required path   int the unique identifier of the stock supplier
Response Codes
Code Condition
200 the supplier was returned
404 no supplier with the given id exists
Response Body
Media Type Data Type Description
application/json StockSupplier
application/xml StockSupplier
Response (XML)
<stockSupplier>
  <id>...</id>
  <ownerAccount>
    <id>...</id>
    <name>...</name>
    <fullName>...</fullName>
    <affiliateId>...</affiliateId>
    <accountDataRetention>
      <id>...</id>
      <keepPersonalDataMonths>...</keepPersonalDataMonths>
      <keepPrintDataMonths>...</keepPrintDataMonths>
    </accountDataRetention>
    <persitenceConfig>
      <id>...</id>
      <archiveDays>...</archiveDays>
      <deleteDays>...</deleteDays>
    </persitenceConfig>
  </ownerAccount>
  <name>...</name>
  <description>...</description>
  <logoPath>...</logoPath>
  <deleted>...</deleted>
  <enabled>...</enabled>
  <enabledForAccount>...</enabledForAccount>
  <type>...</type>
  <lastError>...</lastError>
  <lastRun>...</lastRun>
  <lastSuccess>...</lastSuccess>
  <version>...</version>
</stockSupplier>
Response (JSON)
{
  "stockSupplier" : {
    "id" : 12345,
    "ownerAccount" : {
      "id" : 12345,
      "name" : "...",
      "fullName" : "...",
      "affiliateId" : "...",
      "accountDataRetention" : {
        "id" : 12345,
        "keepPersonalDataMonths" : 12345,
        "keepPrintDataMonths" : 12345
      },
      "persitenceConfig" : { }
    },
    "name" : "...",
    "description" : "...",
    "logoPath" : "...",
    "deleted" : true,
    "enabled" : true,
    "enabledForAccount" : true,
    "type" : "BRANDEX",
    "lastError" : "...",
    "lastRun" : 12345,
    "lastSuccess" : 12345,
    "version" : 12345
  }
}
POST /accounts/{accountId}/stockSuppliers/{supplierId}/availability

Get one supplier's availability for a set of stock items. A stock item is what a product's SKU points at — take the ids from the stockId field of the product's SKUs — and this endpoint answers, for the one supplier in the path, how many units of each it currently reports. Records are named stockSupplierAvailability inside the paged envelope. Two properties of the answer are worth knowing before you build against it:

  • It is not paginated. Every match for the ids you send is returned in one response and totalElements is that count; there are no page or size parameters, so send the whole set of ids in a single call.
  • The answer is sparse. A stock item this supplier has no record for is omitted rather than returned with a zero, so a shorter response than your request is normal and "not carried by this supplier" stays distinguishable from "carried, none in stock".

On a returned record, availableInStock is the number of units the supplier reports as on hand, and shortlyInStock / longerInStock are units it reports as arriving later. Not every supplier's feed carries those two levels; where it does not, both are 0. supplierPlu is the supplier's own article number for the stock item.

Parameters
Name In Default Constraints Description
x-auth-token header     The authentication token
accountId required path   int the unique identifier of the account
supplierId required path   int the unique identifier of the stock supplier whose stock is queried
Request Body
Media Type Data Type Description
application/json IntegerList the stock item ids to ask about, carried in value — {"value": [101, 102]}. An empty list returns an empty page.
application/xml IntegerList
Response Codes
Code Condition
200 the availability records for those stock items this supplier has a record for
Response Body
Media Type Data Type Description
application/json PagedData
application/xml PagedData
Request (XML)
<i----->
  <value>...</value>
</i----->
Request (JSON)
{
  "integerList" : {
    "value" : [ 12345, 12345 ]
  }
}
Response (XML)
<pagedData>
  <records>...</records>
  <totalElements>...</totalElements>
</pagedData>
Response (JSON)
{
  "pagedData" : {
    "records" : [ { }, { } ],
    "totalElements" : 12345
  }
}