Skip to Content

Create a Single-Code Coupon with SAP Omnichannel Promotion Pricing

Learn how to create a single-code coupon using the Coupon Management service of SAP Omnichannel Promotion Pricing.
You will learn
  • How to use the SAP Omnichannel Promotion Pricing services on SAP BTP trial
  • How to create a single-code coupon with the Coupon Management service
BastLenaLena BastJuly 16, 2025
Created by
BastLena
May 6, 2025
Contributors
BastLena

Prerequisites

Get to know the business scenario

  • Business goal: You are a promotion planner. You are launching a promotional campaign for your customers to celebrate your company’s 25th anniversary. As part of the promotional campaign, you want to offer the single-code coupon ANNIVERSARY25 to your customers. The coupon is valid from January 1, 2026 to December 31, 2026.
  • You distribute the coupon ANNIVERSARY25 to your target customers.
  • You create a promotion: Show coupon ANNIVERSARY25 and get 25% off.
  • Because of the great collaboration between your company and SAP in the last years, you want to include SAP in your promotional campaign to celebrate together. So, you create another promotion: Buy one or more products of brand SAP and spend more than EUR 100 to get 10% off. For this promotion, you enable promotion recommendations.
  • Both promotions are valid in your web shop (business unit: ONLINE) from January 1, 2026 to December 31, 2026.
  • A few days after your promotional campaign launched, a customer that received the coupon ANNIVERSARY25 browses through your web shop. Your customer selects a hoodie of brand SAP. The regular sales price for the hoodie is EUR 80. The customer enters the coupon ANNIVERSARY25 when checking out and gets 25% off.
  • Since the shopping cart value is just under EUR 100, a promotion recommendation is displayed to the customer saying that if they add another product of brand SAP so that the shopping cart value is over EUR 100, they get an additional 10% off.
  • To think about this, the customer takes a short coffee break and afterwards browses through the web shop again. Since this took a few minutes, the coupon reservation needed to be extended.
  • The customer adds another hoodie of brand SAP to the shopping cart. Since the shopping cart value is now over EUR 100, they get an additional 10% discount. They proceed to check out and finalize the payment of EUR 108. The coupon code is redeemed in the background.
  • Step 1

    At first, you create a single-code coupon object with the Coupon Management service.

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

    Coupon creation 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 Coupon.
    4. Open the POST request /Coupon.
    5. Copy the following raw data and paste it into the body:

      json
      Copy
      { 
        "status": "INACTIVE",
        "displayID": "ANNIVERSARY25",
        "type": "SINGLECODE",
        "name": "ANNIVERSARY25",
        "validFrom": "2026-01-01",
        "validTo": "2026-12-31",
        "couponCodeValidityPeriodInDays": 365,
        "maxRedemptionCountPerCouponCode": 100000
      }
      
    6. Choose Run.
    7. Make sure you get the HTTP response 201.
    8. From the response, note down the technical coupon ID (ID) as you will need it later.

    The response should look like this:

    Coupon creation response

    With this, you have created a single-code coupon object with the name ANNIVERSARY25 and a validity period from January 1, 2026 to December 31, 2026. The coupon can be redeemed 100,000 times.

    Optional: If you want to check whether you have successfully created the single-code coupon ANNIVERSARY25, you can proceed with the following steps:

    Coupon creation check
    1. On the left-hand side, choose Coupon.
    2. Open the GET request /Coupon.
    3. Choose Run.
    4. Make sure you get the HTTP response 200.
    5. In the response body, you should see the coupon that you have created.
  • Step 2

    When creating the coupon, you set the status of the coupon object to inactive. Now, change the status of the coupon object to active.

    Change status request
    1. On the left-hand side, choose Coupon.
    2. Open the PATCH request /Coupon({ID}).
    3. Choose Parameters.
    4. For ID, enter the technical coupon ID (ID) from the coupon object you have just created.
    5. Copy the following raw data and paste it into the body.

      json
      Copy
      { 
        "status": "ACTIVE"
      }
      
    6. Choose Run.
    7. Make sure you get the HTTP response 200.
    Change status response

    You have now successfully changed the status of the coupon object.

  • Step 3

    Now that you have created the coupon object and set it to active, you create the coupon code to be used in your promotional campaign.

    Create coupon code request
    1. On the left-hand side, choose Coupon.
    2. Open the POST request /Coupon({ID})/CouponManagementService.createCouponCode.
    3. Choose Parameters.
    4. For ID, enter the technical coupon ID (ID) from the coupon object you have just created.
    5. Copy the following data and paste it into the body:

      json
      Copy
      { 
      "codeValue": "ANNIVERSARY25"
      }
      
    6. Choose Run.
    7. Make sure you get the HTTP response 200.
    Create coupon code response

    With this, you have created the coupon code ANNIVERSARY25. Your marketing system can now read the coupon information from the Coupon Management service and drive your promotional campaign, for example by distributing the coupon code to your target customers.

  • Step 4

    You can now continue with the next tutorial Use the SAP Omnichannel Promotion Pricing Apps for Maintaining Promotions and Generic Attributes where you will use the SAP Omnichannel Promotion Pricing apps to make configurations, to maintain a generic attribute, and to upload promotions. You then associate the single-code coupon with a promotion.

Back to top