Skip to Content

Reserve and Redeem a Multi-Code Coupon with SAP Omnichannel Promotion Pricing

Learn how to reserve and redeem a multi-code coupon in a sales transaction using the Coupon Management service of SAP Omnichannel Promotion Pricing and how to calculate the effective sales price using the Calculation service.
You will learn
  • How to use the Coupon Management service of SAP Omnichannel Promotion Pricing in your trial environment on SAP BTP
  • How to reserve and redeem a coupon code with the Coupon Management service
  • How to calculate the effective sales price in a sales transaction with the Calculation service of SAP Omnichannel Promotion Pricing by applying a coupon that triggers a discount on an item in the shopping cart
Aathira-I553036Aathira PMay 6, 2025
Created by
BastLena
December 6, 2024
Contributors
BastLena

Prerequisites

Get to know the business scenario

  • Business goal: You are a promotion planner working for a coffee machine vendor. As sales has slowed down, you launched a promotional campaign for your target group coffee lovers in the Heidelberg region.
  • As part of this promotional campaign, you have created a multi-code coupon with the coupon ID COFFEE LOVER. The coupon is valid from October 1, 2026 to December 31, 2026. For this, you have generated a batch of unique coupon codes that can be redeemed only once by each customer.
  • You have distributed the coupon COFFEE LOVER with the unique coupon codes to your target customers.
  • You have also created a promotion: Buy a coffee machine and show the coupon COFFEE LOVER to get EUR 50 off.
  • The promotion is valid in your Heidelberg store (business unit ID: FC01) from October 1, 2026 to December 31, 2026.
  • On October 25, 2026, one of your customers that received the coupon COFFEE LOVER comes to your Heidelberg store to purchase a coffee machine. Your customer selects a coffee machine (material number: COFFEE_MACHINE). The regular sales price for the coffee machine is EUR 1000. The customer presents the coupon COFFEE LOVER to the cashier.
  • The POS system calls the Coupon Management service to reserve the coupon code.
  • The cashier continues to complete the purchase. The POS system calls the Calculation service with the shopping cart information. The Calculation service calculates the effective sales price for the coffee machine (regular price minus discount granted by the coupon) and returns it to the POS.
  • Your customer completes the purchase. The POS triggers a request to the Coupon Management service to redeem the coupon code. The redemption information is returned to the POS, which confirms the completion of the payment to the customer. Your customer is now done and returns home happily with a new coffee machine.
  • Step 1

    In order to continue with the next steps, you need to have already set up your trial environments for the Coupon Management service, Data Upload service, Data Access service, and Calculation service in the SAP Business Accelerator Hub. If you need guidance, have a look at step 2 of the tutorial Apply a Simple Promotion with SAP Omnichannel Promotion Pricing.

  • Step 2

    You can now reserve a coupon code for the multi-code coupon COFFEE LOVER using the Coupon Management service.

    Scenario: In your Heidelberg store (business unit ID: FC01), your customer has selected a coffee machine (material number: COFFEE_MACHINE, regular sales price: EUR 1000). At the time of check-out, the customer presents the coupon code for the multi-code coupon COFFEE LOVER to the cashier. The client system calls the Coupon Management service to reserve the coupon code.

    Desired Result: The coupon code is reserved.

    Let’s see if this is the case:

    Navigate to the Coupon Management service of SAP Omnichannel Promotion Pricing on SAP Business Accelerator Hub. Log on with the same login information that you use for your SAP BTP account.

    Reserve coupon code
    1. Navigate to the Try Out section.
    2. On the right-hand side, select the trial environment you have created for the Coupon Management service.
    3. On the left-hand side, choose Service Operation.
    4. Open the POST request /reserveCouponCode.
    5. Copy the following data and paste it into the body. Make sure to enter the coupon code value (codeValue) that you have noted down in the previous tutorial.

      json
      Copy
      { 
        "couponCodeValue": "string",
         "reservationDate": "2026-10-25",
         "transactionID": "string"
      }
      
    6. Choose Run.
    7. Make sure you get the HTTP response 200.
    8. From the response, note down the redemptionInfoID and the reservationToken.

    The response should look like this:

    Reserve coupon code success

    With this, you have reserved the coupon code for 30 minutes. It is also possible to extend the reservation by 30 minutes.

    How long is the default reservation time for a coupon code?

  • Step 3

    You can now calculate the effective sales price using the Calculation service.

    Scenario: In your Heidelberg store (business unit ID: FC01), your customer has selected a coffee machine with a regular price of EUR 1000. At the time of check-out on October 25, 2026, the customer presents the coupon code for the multi-code coupon COFFEE LOVER to the cashier.

    Desired Result: The effective sales price for the coffee machine should be EUR 950, as the customer is eligible for the promotion Buy a coffee machine and show the coupon COFFEE LOVER to get EUR 50 off.

    Let’s see if this is the case:

    Navigate to the Calculation service of SAP Omnichannel Promotion Pricing on SAP Business Accelerator Hub. Log on with the same login information that you use for your SAP BTP account.

    Calculation request
    1. Navigate to the Try Out section.
    2. On the right-hand side, select the trial environment you have created for the Calculation service.
    3. Open the POST request /restapi/{tenantname}.
    4. For the tenantName, enter the identityzone from the service key you have created for the Calculation service in your SAP BTP account. If you need assistance, see step 4 of the tutorial Set Up SAP Omnichannel Promotion Pricing .
    5. Copy the following data and paste it into the body. As the content type, choose XML.

      XML
      Copy
      <PriceCalculate
                 xmlns="http://www.sap.com/IXRetail/namespace/" InternalMajorVersion="15" InternalMinorVersion="0">
                 <ARTSHeader ActionCode="Calculate" MessageType="Request">
                                 <MessageID>9a89f2edfd1e413ea147e334b9c2ed4b</MessageID>
                                 <DateTime>2026-10-25T00:00:00.427-05:00</DateTime>
                                 <BusinessUnit TypeCode="RetailStore">FC01</BusinessUnit>
                                 <MasterDataSourceSystemID>RS9CLNT990</MasterDataSourceSystemID>
                 </ARTSHeader>
                 <PriceCalculateBody TransactionType="SaleTransaction" NetPriceFlag="true" RecommendationMode="CalcAndRec">
                                 <TransactionID>9a89f2edfd1e413ea147e334b9c2ed4b</TransactionID>
                                 <DateTime>2026-10-25T16:48:30.427-05:00</DateTime>
                                 <RegularSalesUnitPriceRoundingRule Multiple="0.01000" RoundingMethod="Commercial"/>
                                 <ShoppingBasket>
                                                 <LineItem>
                                                                 <SequenceNumber>0</SequenceNumber>
                                                                 <MerchandiseHierarchy ID="R3">COFFEEMACHINES</MerchandiseHierarchy>
                                                                 <Sale ItemType="Stock" NonDiscountableFlag="false" FixedPriceFlag="true" FrequentShopperPointsEligibilityFlag="true">
                                                                                 <TaxIncludedInPriceFlag>false</TaxIncludedInPriceFlag>
                                                                                 <NonPieceGoodFlag>false</NonPieceGoodFlag>
                                                                                 <NotConsideredByPriceEngineFlag>false</NotConsideredByPriceEngineFlag>
                                                                                 <ItemID>COFFEE_MACHINE</ItemID>
                                                                                 <Quantity Units="1" UnitOfMeasureCode="EA">1</Quantity>
                                                                                 <RegularSalesUnitPrice Currency="EUR">1000.0</RegularSalesUnitPrice>
                                                                 </Sale>
                                                 </LineItem>
                                                  <LineItem>
                                 <SequenceNumber>1</SequenceNumber>
                                 <Coupon>
                                                 <PrimaryLabel>COFFEE LOVER</PrimaryLabel>
                                                 <Quantity>1</Quantity>
                                 </Coupon>
      </LineItem>  
                                 </ShoppingBasket>
                 </PriceCalculateBody>
      </PriceCalculate>
      
    6. Choose Run.
    7. Make sure you get the HTTP response 200.

    The response should look like this:

    Calculation success

    With this, the Calculation service has calculated the effective sales price of EUR 950 for the coffee machine by applying the promotion Buy a coffee machine and show the coupon COFFEE LOVER to get EUR 50 off. It then returns the effective sales price to the POS.

  • Step 4

    You can now redeem the coupon code for the multi-code coupon COFFEE LOVER using the Coupon Management service.

    Scenario: The customer has completed the purchase of the coffee machine for which they used the coupon COFFEE LOVER with the respective coupon code. The POS system calls the Coupon Management service to redeem the coupon code. The redemption information is returned to the system which then confirms the completion of the purchase.

    Desired Result: The coupon code is redeemed.

    Let’s see if this is the case:

    Navigate to the Coupon Management service of SAP Omnichannel Promotion Pricing on SAP Business Accelerator Hub. Log on with the same login information that you use for your SAP BTP account.

    Redemption request
    1. Navigate to the Try Out section.
    2. On the right-hand side, select the trial environment you have created for the Coupon Management service.
    3. On the left-hand side, choose Redemption Information.
    4. Open the POST request /RedemptionInfo({ID})/CouponManagementService.redeemCouponCode.
    5. Under Parameters, enter the redemptionInfoID which you noted down when you reserved the coupon code.
    6. In the body, replace string with the reservationToken which you noted down when you reserved the coupon code.
    7. Choose Run.
    8. Make sure you get the HTTP response 200.

    The response should look like this:

    Redemption success

    With this, you have successfully redeemed the coupon code. The redemption information is returned to the POS which then confirms the completion of payment. Your customer has now successfully purchased the coffee machine at a discounted price.

Back to top