The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Sample Basket Usage Scenario in Digital Commerce

You can add an offer without any configured attribute values to a basket.

  1. Follow the prerequisites.

  2. Ensure you have run the appropriate batch jobs and configured the appropriate custom settings. See Preparing Digital Commerce API Caching.

  3. Execute a call to the Get Offer Details API.

  4. After successfully running GetOfferDetails, copy and save the entire contents of the OfferDetails node. For example:


    To configure the offer before adding it to the basket, modify the offerDetails JSON result.

  5. Paste the result node from the previous step into the body of the Basket API request.

  6. Execute the Create Basket API call: