All Collections
API
How to Use Pricing Tables with GetAccept API
How to Use Pricing Tables with GetAccept API

Learn how to create a Pricing Table from GetAccept's API.

Updated over a week ago

This article is meant for a technical user, with access to GetAccept API and Product Library. If you're wondering how to use the feature within GetAccept without access to the API, click here. If you are using Salesforce CPQ together with GetAccept, we have a guide for you here.

A Pricing Table is an GetAccept Editor element you can use to create powerful CPQ workflows.

In this article, you'll learn about:

  • Setting up a Template

  • API: Reading Pricing Tables from a Template

  • API: Creating a Document using Pricing Table with values

  • API: Reading Pricing Tables from a Document

  • API: Updating a Document Pricing Table after sending a Document

Setting up a Template

In order to access Pricing Tables from the API, you need to create a Template with a placeholder Pricing Table. Essentially, wherever you place the Pricing Table and how you configure it will be preserved, once we start creating documents using this template. Any values left in this template will not be kept.

Here's a quick refresher on how to add a Pricing Table in your Template:

  1. In a template, create a new Editor block

  2. Click the blue plus sign, select Add a new element and pick Pricing Table

  3. Now you can configure your pricing table according to your needs. We have a rather detailed guide on what you can configure with your Pricing Table here

As an example, we've set up a Template that looks something like this:

API: Reading Pricing Tables from a Template

The next step in the journey is to map the identifiers and columns from the Pricing Table to your relevant data set. In order to get the identifiers for a Template, call this endpoint:

GET https://api.getaccept.com/v1/templates/{template_id}/pricing-tables

You can find the template_id in the top section while you're editing your Template in the Template view in GetAccept.

The endpoint returns a list of Pricing Tables as pricing_tables. Look for table_id to identify a table. Each Pricing Table Section also contains an ID, you can find that in pricing_tables[].sections[].section_id. These identifiers are necessary for the next step. Another crucial part is that each section contains a list of columns.

API: Creating a Document using Pricing Table with values

To create a new Document, use the following endpoint:

POST https://api.getaccept.com/v1/documents

With the following body (please click the caret to expand)

{
"is_automatic_sending": false,
"is_reminder_sending": false,
"name": "Pricing Table Demo Offer",
"template_id": "REPLACE_WITH_YOUR_TEMPLATE_ID",
"recipients": [
{
"first_name": "Alice",
"last_name": "Carill",
"email": "alice.carill@foobar.com",
"role": "signer"
}
],
"custom_pricing_tables": [
{
"summary_values": {
"tax": {
"value": "",
"flat_fee": true,
"enabled": false
},
"price": {
"value": "1.00",
"flat_fee": true,
"enabled": true
},
"discount": {
"value": "",
"flat_fee": true,
"enabled": false
}
},
"sections": [
{
"rows": [
{
"values": [
{
"column_id": "REPLACE_COLUMN_ID_1",
"value": "Super Product"
},
{
"column_id": "REPLACE_COLUMN_ID_2",
"value": "The best product out there."
},
{
"column_id": "REPLACE_COLUMN_ID_3",
"value": ""
},
{
"column_id": "REPLACE_COLUMN_ID_4",
"value": "123"
},
{
"column_id": "REPLACE_COLUMN_ID_5",
"value": "2"
},
{
"column_id": "REPLACE_COLUMN_ID_6",
"value": ""
},
{
"column_id": "REPLACE_COLUMN_ID_7",
"value": ""
},
{
"column_id": "REPLACE_COLUMN_ID_8",
"value": ""
},
{
"column_id": "REPLACE_COLUMN_ID_9",
"value": "246"
}
]
}
],
"id": "REPLACE_WITH_PRICING_TABLE_SECTION_ID",
"display_name": "Best Offer for You"
}
],
"pre_calculated": true,
"id": "REPLACE_WITH_PRICING_TABLE_ID",
"display_name": null,
"currency_settings": {
"locale": "en-US",
"currency": "USD"
}
}
]
}

We're using a simple body for this example to illustrate the Pricing Table feature. To explore all possibilities you can utilise with GetAccept's API, please review the API Reference for Create Document.

This is what the POST request above would resolve to in GetAccept

API: Detailed Reference for Custom Pricing Tables

Here are all the properties of the custom_pricing_tables:

Property Name

Type

Required

Details

id

String

The ID of the Pricing Table. More info how to obtain this value is in the section above.

locked

Boolean

Whether the table should allow edits in GetAccept, using Edit After Send flow. This value is true by default.

display_name

String | null

Display name above the table. You can send this property as an empty string if you want to omit the value from being presented to the user.

To use template default value, pass null.

currency_settings

Object | null

The currency configuration for the table. For more info, see Currency Settings.

To use template default value, pass null.

summary_values

Object

Values and configuration for the summary (appears at the bottom of the table with totals). For more info, see Summary Values.

sections

Array

Values and configuration for each row in the list of Sections. For more info, see Sections.

pre_calculated

Boolean

If false, this will let GetAccept Pricing Table to automatically calculate the values.

If true, you need to provide a value in the summary_values object, otherwise the default will be 0.00 of your currency equivalent.

Currency Settings

Controls what currency will be used for the Pricing Table. Currency is a top level property; all sections in a table will have only 1 currency.

If you wish to keep the Template default Currency, send null instead of the configuration object.

Property Name

Type

Required

Details

locale

String

Combination of IETF BCP 47 and ISO 3166-1, separated by a dash "-".

Examples:

  • sv-SE (Swedish, Sweden)

  • en-US (English, United States)

  • tr-TR (Turkish, Turkey)

currency

String

ISO-4217 currency code. We support all ISO-4217 valid currencies.

Summary values

Contains the content of a Pricing Summary that appears beneath the Pricing Table:

Here would be an example summary_values to achieve the above summary:

{   
...previous pricing table required data,
"summary_values": {
"discount": {
"value": "24",
"flat_fee": false,
"enabled": true
},
"tax": {
"value": "10",
"flat_fee": true,
"enabled": true
},
"price": {
"value": "196.96",
"flat_fee": true,
"enabled": true
}
}
}

There are three properties in total:

  • discount - Discount from the figure above

  • tax - Tax from the figure above

  • price - Total from the figure above

All of these properties have the following object structure:

Property Name

Type

Required

Details

value

String

The overall value of the field.

If the fields have flat_value equal to true - this will be a value like "123.44" and the table will use the currency settings to present a value.

If the fields have flat_value equal to false - this will be a percentage instead, like "24" and the table will present 24%.

If the value is not known or relevant, send an empty string ("").

flat_value

Boolean

Decides whether the field has a monetarily representative value (e.g. $15.00; when flat_value = true) or a percentage value (e.g. 24%; when flat_value = false).

enabled

Boolean

If the field should be shown in the summary or not.

display_name

String

Display name accompanying the field. Examples: "Total Price", "Our Awesome Discount", "Loyalty Price", "U.S. Sales Tax"

Sections

Sections refers to Pricing Table Sections. Each section can have its own Summary, very similar to the Summary values section above. It also contains all the Line Items - represented as rows. Here are all of the properties of a Section:

Property Name

Type

Required

Details

id

String

The ID of the Pricing Table Section.

display_name

String

If provided, this will be a text shown above the Pricing Table Section.

section_summary

Object

Values and configuration for the Section summary. Can be used to present subtotals. Uses the same configuration as Summary Values.

rows

Array[Row]

List of Rows representing the individual line items. See below for how an individual Row looks like.

Row

A Row in a Pricing Table is equivalent to a line item. Here are all of the properties of a Row:

Property Name

Type

Required

Details

external_id

String

External ID to reference a row. If your system uses and depends an identifier, you can use this field to keep track of it.

tax_flat_fee

Boolean

Whether the tax will be shown as a flat fee (when true) or as a percentage (when false)

discount_flat_fee

Boolean

Whether the discount will be shown as a flat fee (when true) or as a percentage (when false)

values

Array[RowValue]

This is a list of values, mapping them 1:1 to the Column IDs. Refer to API: Reading Pricing Tables from a Template for more about Columns. You need to map each Column ID to a RowValue.

RowValue

This is a list of values, mapping them 1:1 to the Column IDs. Refer to API: Reading Pricing Tables from a Template for more about Columns. You have to map each Column ID to a RowValue (if there are 5 columns in Pricing Group, you'd provide 5 Column IDs here.)

Property Name

Type

Required

Details

value

String

Value of the column. Always send in strings, even for numbers.

column_id

String

GetAccept Pricing Section Column ID.

is_markdown

Boolean

Set this to true if the value field is Markdown.

API: Reading Pricing Tables from a Document

In this section, we'll describe how to get values from the Pricing Tables from a Document. This might be useful when you're trying to import data from your CPQ workflows using data from a signed GetAccept document.

Another workflow where this endpoint is crucial is getting values for our Edit After Send flow. More about that in the next section.

In order to get the data from a Document, call this endpoint:

GET https://api.getaccept.com/v1/documents/{document_id}/pricing-tables


The output is very similar to the Template version of this endpoint.

Here is a sample output (please click the caret to expand)

{
"pricing_tables": [
{
"table_id": "fOlpofN7-OSCAArlnSYfo",
"external_id": null,
"name": null,
"display_name": "",
"summary_settings": {
"summary_enabled": true
},
"pre_calculated": false,
"currency_settings": {
"currency": "USD",
"locale": "en-US"
},
"sections": [
{
"section_id": "1z-wzICAmx1GPQWgfn5AY",
"name": null,
"display_name": "Best Offer for You",
"section_summary_settings": {
"summary_enabled": false
},
"columns": [
{
"column_id": "H_Cc3-ffDGDT0alng-5qD",
"name": "name",
"display_name": "Name",
"enabled": true
},
{
"column_id": "-gXSWsKKK47qoTy2M0KP3",
"name": "description",
"display_name": "Description",
"enabled": true
},
{
"column_id": "3wmjAGCkSFo04-BAIhKzD",
"name": "sku",
"display_name": "SKU",
"enabled": true
},
{
"column_id": "fMvGzeKINFfTXWlf-nwgs",
"name": "price",
"display_name": "Price",
"enabled": true
},
{
"column_id": "ADBdSln0iEw17fpG44FfP",
"name": "units",
"display_name": "Units",
"enabled": true
},
{
"column_id": "rilMBHS883cAUa1cdvOjI",
"name": "tax",
"display_name": "Tax",
"enabled": false
},
{
"column_id": "OQxYm2nYUu8CvLiUF8-NJ",
"name": "discount",
"display_name": "Discount",
"enabled": true
},
{
"column_id": "8D-FmX3J6RuZ6ccDeHduk",
"name": "netPrice",
"display_name": "Net price",
"enabled": true
},
{
"column_id": "5fNyEf7DFAZXbzFCTF_4o",
"name": "totalPrice",
"display_name": "Total price",
"enabled": true
}
],
"rows": [
{
"row_id": "32nSDyYY02alZ3Cjrp73O",
"external_id": null,
"values": [
{
"column_id": "H_Cc3-ffDGDT0alng-5qD",
"value": "Super Product"
},
{
"column_id": "-gXSWsKKK47qoTy2M0KP3",
"value": "One could say, the best product out there."
},
{
"column_id": "3wmjAGCkSFo04-BAIhKzD",
"value": ""
},
{
"column_id": "fMvGzeKINFfTXWlf-nwgs",
"value": "123"
},
{
"column_id": "ADBdSln0iEw17fpG44FfP",
"value": "2"
},
{
"column_id": "rilMBHS883cAUa1cdvOjI",
"value": ""
},
{
"column_id": "OQxYm2nYUu8CvLiUF8-NJ",
"value": "50"
},
{
"column_id": "8D-FmX3J6RuZ6ccDeHduk",
"value": "196"
},
{
"column_id": "5fNyEf7DFAZXbzFCTF_4o",
"value": "246"
}
]
}
]
}
]
}
]
}

API: Updating a Pricing Table after sending a Document

Once you send a Document with a Pricing Table, there could be adjustments you need to add to the table from your system — such as adding a new item, modifying a discount or adjusting tax after negotiating with your buyers.

You don't need to create a new version of the Document. You can use GetAccept's Edit After Send flow and update the table live in the Document.

Please note that updating a Document is only allowed for Documents that haven't been signed by any one party, and we reserve a right to introduce other restrictions in the future.

How to use Edit after Send for Pricing Tables

  1. Create a Document with a Pricing Table. Find out more in this guide.

  2. Fetch the latest structure of the Pricing Table from a Document.

  3. Send a HTTP PUT to https://api.getaccept.com/v1/documents/{DOCUMENT_ID}/pricing-tables

    Find more about this in our API documentation. This has the same exact body as for creating a Document with a Pricing Table. The only difference for you might be that you provide the Column IDs from a Document, not from a Template.

  4. Publish the new version by sending a HTTP POST to https://api.getaccept.com/v1/documents/{DOCUMENT_ID}/revisions

    Find more about this in our API documentation.

Did this answer your question?