Inventory

GET Query

GET /services/data/v51.0/query

Operation ID: Query. Tags: Inventory. Security: bearerAuth.

To look up information about inventory, use the Query resource of the main REST API from Salesforce and set the value of the q parameter to an SOQL query. The following examples are included in the query parameters section of this page, with corresponding examples in the responses section:

Example 1 of 2: getInventoryBySellerId

This call allows the seller’s inventory information to be searched. If you do not know the External ID of the inventory, this call can be used to search for this information.

Example 2 of 2: getInventoryRecordsByInventoryId

This call allows the listing of the stock of all SKUs within a specific inventory using the External ID. Depending on the quantity, the results may require pagination.

Parameters

  • q (query, string)

    Example: getInventoryBySellerId

    SELECT FIELDS(ALL) FROM Atonit_Mktplace__Inventory__c WHERE Atonit_Mktplace__Seller__r.Atonit_Mktplace__Slug__c= '{{seller-external-id}}' LIMIT 200

    Example: getInventoryRecordsByInventoryId

    SELECT Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Inventory__r.Atonit_Mktplace__External_Id__c, Atonit_Mktplace__Product_Variant__r.Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Quantity__c  FROM Atonit_Mktplace__Inventory_Record__c WHERE Atonit_Mktplace__Inventory__r.Atonit_Mktplace__External_Id__c= '{{seller-api-prefix}}-inventory' LIMIT 200

Responses

  • 200 OK

    Headers:

    • Date (string)
      Example: Fri, 23 Apr 2021 19:04:51 GMT.
    • Strict-Transport-Security (string)
      Example: max-age=31536002; includeSubDomains.
    • X-Content-Type-Options (string)
      Example: nosniff.
    • X-XSS-Protection (string)
      Example: 1; mode=block.
    • X-Robots-Tag (string)
      Example: none.
    • Cache-Control (string)
      Example: no-cache,must-revalidate,max-age=0,no-store,private.
    • Sforce-Limit-Info (string)
      Example: api-usage=1456/101002.
    • Content-Type (string)
      Example: application/json;charset=UTF-8.
    • Vary (string)
      Example: Accept-Encoding.
    • Content-Encoding (string)
      Example: gzip.
    • Transfer-Encoding (string)
      Example: chunked.

    Media type: application/json. Schema: object.

    Example: getInventoryBySellerId

    {
      "totalSize": 1,
      "done": true,
      "records": [
        {
          "Id": "a0A5Y00001JJoqmUAD",
          "Name": "W-0000",
          "CreatedDate": "2021-03-22T21:39:57.000+0000",
          "LastModifiedDate": "2021-04-22T19:22:50.000+0000",
          "Atonit_Mktplace__Name__c": "atonit-vitta-inventory",
          "Atonit_Mktplace__Seller__c": "a0T5Y00000ZE4lFUAT",
          "Atonit_Mktplace__External_Id__c": "atonit-vitta-inventory"
        }
      ]
    }

    Example: getInventoryRecordsByInventoryId

    {
      "example": {
        "totalSize": 5,
        "done": true,
        "records": [
          {
            "Atonit_Mktplace__External_Id__c": "atonit-vitta-inventory-atonit-vitta-sku-1",
            "Atonit_Mktplace__Inventory__r": {
              "Atonit_Mktplace__External_Id__c": "atonit-vitta-inventory"
            },
            "Atonit_Mktplace__Product_Variant__r": {
              "Atonit_Mktplace__External_Id__c": "atonit-vitta-sku-1"
            },
            "Atonit_Mktplace__Quantity__c": 88
          }
        ]
      }
    }