Price Books

GET Query

GET /services/data/v51.0/query

Operation ID: Query. Tags: Price Book. Security: bearerAuth.

To look up information about price books, 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 4: getSimplePriceBookBySellerId

This call allows the searching of information about the seller’s simple price book. If you do not know the external ID of the price book, this call can be used to search for that information.

Example 2 of 4: getPriceBookEntryByPriceBookId

This call allows the listing of the price of all SKUs within a specific price book using the external ID. Depending on the quantity, the results may require pagination.

Example 3 of 4: getSalePriceBookBySellerId

This call allows the searching of the seller’s sale price book information. If you do not know the external ID of the price book, this call can be used to search for that information.

Example 4 of 4: getAllCustomerGroups

For customer group price books, a connection needs to be made with a customer group. This value must be one of the values from the marketplace (if none of them apply, contact the marketplace to check whether a new one can be inserted). In order to insert this relationship, you must first request an export of the data to the marketplace or access the APU directly and save the list. If the item limit is exceeded, pagination may be necessary, in which case please refer to the following documentation.

Parameters

  • q (query, string)

    Example: getSimplePriceBookBySellerId

    SELECT FIELDS(ALL) FROM Atonit_Mktplace__PriceBook__c WHERE Atonit_Mktplace__Seller__r.Atonit_Mktplace__Slug__c= '{{seller-external-id}}' AND RecordType.Name = 'Default PriceBook' LIMIT 200

    Example: getPriceBookEntryByPriceBookId

    SELECT Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Price_Book__r.Atonit_Mktplace__External_Id__c, Atonit_Mktplace__Product_Variant__r.Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Quantity__c,Atonit_Mktplace__Price__c  FROM Atonit_Mktplace__Price_Book_Entry__c WHERE Atonit_Mktplace__Price_Book__r.Atonit_Mktplace__External_Id__c= '{{seller-api-prefix}}-pricebook' LIMIT 200

    Example: getSalePriceBookBySellerId

    SELECT FIELDS(ALL) FROM Atonit_Mktplace__PriceBook__c WHERE Atonit_Mktplace__Seller__r.Atonit_Mktplace__Slug__c= '{{seller-external-id}}' AND RecordType.Name = 'Sale PriceBook' LIMIT 200

    Example: getAllCustomerGroups

    SELECT FIELDS(ALL) FROM Atonit_Mktplace__Customer_Group__c   LIMIT 200

Responses

  • 200 OK

    Headers:

    • Date (string)
      Example: Fri, 23 Apr 2021 19:03:24 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: getSimplePriceBookBySellerId

    {
      "totalSize": 1,
      "done": true,
      "records": [
        {
          "Id": "a0H5Y00001JDrCiUAL",
          "Name": "PB-0004",
          "CreatedDate": "2021-03-23T16:43:00.000+0000",
          "LastModifiedDate": "2021-04-23T14:57:46.000+0000",
          "Atonit_Mktplace__Name__c": "atonit-vitta PriceBook Default",
          "Atonit_Mktplace__Seller__c": "a0T5Y00000ZE4lFUAT",
          "Atonit_Mktplace__External_Id__c": "atonit-vitta-pricebook"
        }
      ]
    }

    Example: getPriceBookEntryByPriceBookId

    {
      "totalSize": 6,
      "done": true,
      "records": [
        {
          "Atonit_Mktplace__External_Id__c": "atonit-vitta-pricebook-atonit-vitta-sku-1-1",
          "Atonit_Mktplace__Price_Book__r": {
            "Atonit_Mktplace__External_Id__c": "atonit-vitta-pricebook"
          },
          "Atonit_Mktplace__Product_Variant__r": {
            "Atonit_Mktplace__External_Id__c": "atonit-vitta-sku-1"
          },
          "Atonit_Mktplace__Quantity__c": 1,
          "Atonit_Mktplace__Price__c": 45.33
        }
      ]
    }

    Example: getSalePriceBookBySellerId

    {
      "totalSize": 1,
      "done": true,
      "records": [
        {
          "Id": "a0H5Y00001JEngLUAT",
          "Name": "PB-0009",
          "CreatedDate": "2021-04-23T13:58:09.000+0000",
          "LastModifiedDate": "2021-04-23T14:57:25.000+0000",
          "Atonit_Mktplace__Name__c": "atonit-vitta PriceBook Sale",
          "Atonit_Mktplace__Seller__c": "a0T5Y00000ZE4lFUAT",
          "Atonit_Mktplace__Parent_Price_Book__c": "a0H5Y00001JDrCiUAL",
          "Atonit_Mktplace__External_Id__c": "atonit-vitta-pricebook-sale"
        }
      ]
    }