Set a discount using the Checkout API

One of the most used customer attraction strategies in ecommerce is applying a discount to the cash price when choosing a specific payment method. Commonly, the discount price is visible only at the checkout payment stage after the user has already chosen the payment method that grants the discount.

This Checkout configuration sets the discount price and links it to a payment method. To configure, follow the steps below:

  1. Use the Checkout configuration API request to enter the desired payment method ID in the paymentSystemToCheckFirstInstallment property.

  2. To get the payment method ID, access Settings in the Payments module. The ID of the condition you want to use is on the right side of the screen in the Payments Settings > Payments Conditions section.

  1. After updating paymentSystemToCheckFirstInstallment, you can run the Do OrderForm Simulation endpoint. Thus, you will be able to verify that the chosen payment method has been updated with the discount in the cash payment option in the installmentOptions section, within paymentData.
         "paymentName":"Boleto Bancário",

For more information, check Configuring a discount for orders prepaid in full.