Pricebook2

Represents a price book that contains the list of products that your org sells.

Introduced in API version 3.0.

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

  • Type: string
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: Text description of the price book.
  • Type: string
  • Properties: Create, Filter, Group, idLookup, Nillable, Sort, Update
  • Introduced: API version 68.0
  • Type: boolean
  • Properties: Create, Defaulted on create, Filter, Group, Sort, Update
  • Description: Indicates whether the price book is active (true) or not (false). Inactive price books are hidden in many areas in the user interface. You can change this field’s value as often as necessary. Label is Active.
  • Default value: false
  • Type: boolean
  • Properties: Defaulted on create, Filter, Group, Sort
  • Introduced: API version 39.0
  • Description: Indicates whether the price book has been archived (true) or not (false). This field is read only.
  • Default value: false
  • Type: boolean
  • Properties: Defaulted on create, Filter, Group, Sort
  • Description: Indicates whether the price book is the standard price book for the org (true) or not (false). Every org has one standard price book—all other price books are custom price books.
  • Default value: false
  • Type: string
  • Properties: Create, Filter, Group, idLookup, Sort, Update
  • Description: Required. Name of this object. This field is read-only for the standard price book. Label is Price Book Name.
  • Type: datetime
  • Properties: Create, Filter, Nillable, Sort, Update
  • Introduced: API version 46.0
  • Description: The date and time when a Commerce price book is initially valid. If this field is null, the price book is valid immediately when active.
  • Type: datetime
  • Properties: Create, Filter, Nillable, Sort, Update
  • Introduced: API version 46.0
  • Description: The date and time when a Commerce price book is valid to. If this field is null, the price book is valid until it’s deactivated.

A price book is a list of products that your org sells.

  • Each org has one standard price book that defines the standard or generic list price for each product or service that it sells.
  • An org can have multiple custom price books to use for specialized purposes, such as for discounts, different channels or markets, or select accounts or opportunities. While your client application can create, delete, and update custom price books, your client application can only update the standard price book.
  • For some orgs, the standard price book is the only price needed. If you set up other price books, you can reference the standard price book when setting up list prices in custom price books.

Use this object to query standard and custom price books that have been configured for your org. A common use of this object is to allow your client application to obtain valid Pricebook2 object IDs for use when configuring PricebookEntry records via the API.

Your client application can perform the following tasks on PricebookEntry objects:

  • Query
  • Create for the standard price book or custom price books.
  • Update
  • Delete
  • Change the IsActive field when creating or updating records

In the API:

  • Price books are represented by Pricebook2 records (as of version 8.0, the Pricebook object is no longer available).
  • Products are represented by Product2 records (as of version 8.0, the Product object is no longer available).
  • Each price book contains zero or more entries (represented by PricebookEntry records) that specify the products that are associated with the price book. A price book entry defines the price for which you sell a product at a particular currency.

These objects are defined only for those orgs that have products enabled as a feature. If the org doesn’t have the products feature enabled, the Pricebook2 object doesn’t appear in the describeGlobal() call, and you can’t access it via the API.

If you delete a Pricebook2 while a line item references PricebookEntry in the price book, the line item is unaffected, but the Pricebook2 is archived and unavailable from the API.

For a visual diagram of the relationships between Pricebook2 and other objects, see Product and Schedule Objects.

The process of setting up a price book via the API usually means:

  1. Load product data into Product2 records (creating one Product2 record for each product that you want to add).
  2. For each Product2 record, create a PricebookEntry that links the Product2 record to the standard Pricebook2. Define a standard price for a product at a given currency (if you have multicurrency enabled) before defining a price for that product in the same currency in a custom price book.
  3. Create a Pricebook2 record to represent a custom price book.
  4. For each Pricebook2 record, creating a PricebookEntry for every Product2 that you want to add, specifying unique properties for each PricebookEntry (such as the UnitPrice and CurrencyIsoCode) as needed.

This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version.