Newer Version Available

This content describes an older version of this product. View Latest

Use Promotion Business Objects API

Promotion Business Object API can be accessed through REST API, Aura Components, and Lightning Web Component.

REST API

To process records with Promotion BO API, you need to use the provided REST endpoints in the defined process:

  1. Initialize a transaction with the number of records to process:
    1. URL: <ORG INSTANCE>/services/apexrest/cgcloud/promotions/initialize

      METHOD: POST

      PAYLOAD:
    2. This request returns an import ID that should be passed to every subsequent requests.
  2. Queue the records to process in blocks of 50 records.
    1. URL: <ORG INSTANCE>/services/apexrest/cgcloud/promotions/ingest

      METHOD: POST

      PAYLOAD:
    2. Each call can contain up to 50 records.
    3. You can send as many requests to fill the “nrOfItems” defined in the request sent to initialize a transaction.
  3. Monitor the process.
    1. URL: <ORG INSTANCE>/services/apexrest/cgcloud/promotions/status?importId=<import Id>

      METHOD: GET

    2. This returns the status for all records part of the transaction.

Aura

You can send requests to the Promotion BO API from an Aura Component.

Component markup
Component controller

Lightning Web Component

Only available when Lightning Web Security is enabled in the organization.

Note

Component controller