Skip to content
Order Editing

Post-Purchase Discount Codes

Let customers apply a Shopify discount code to an existing order and control eligibility, refunds, revalidation, and one-time codes.

4 min read

Use the Discount Codes editing block to let customers apply a Shopify discount code after checkout. Because a new discount can reduce the order total, Order Editing handles the difference as an order downgrade and partial refund.

Before you begin

  • Turn on order downgrades and select a downgrade refund method.
  • Grant Order Editing Shopify's discount-writing permission for features that recalculate or disable discount codes.
  • Review the combination rules on the discounts in Shopify. Order Editing evaluates the code against Shopify's discount configuration.

Enable post-purchase discount codes

  1. In Order Editing, open App Settings.
  2. Select Editing blocks.
  3. Open Discount Codes.
  4. Turn on Allow customers to redeem post-purchase discount codes.
  5. Choose the eligibility and restriction settings that match your policy.
  6. Save the changes.

If order downgrades are off, the page asks you to turn them on before the discount-code block can be activated. A newly enabled setup without a refund method defaults to payment-method refunds so the feature can operate, but you should still review the downgrade settings.

Configure expired codes

Setting

What it does

Allow customers to redeem expired discount codes

Lets Order Editing consider a code after its configured end date, which can cover a promotion that ends before the editing window.

Allowing an expired code intentionally extends when the customer can use that promotion through Order Editing. Confirm that outcome matches your campaign policy.

Set discount eligibility

Setting

What it changes

Requirement

Allow a maximum of one discount code per order

Evaluates only the newly submitted code instead of combining it with codes already on the order.

None beyond an enabled discount-code block.

Recalculate discount codes eligibility

Rechecks existing codes and automatic promotions after each edit and removes those that no longer qualify. The customer is warned before saving.

Shopify discount-writing permission.

Exclude digital products from qualifying for post-purchase discount codes

Limits the post-purchase discount to products being shipped.

The discount-code block must be enabled.

Disable one-time discount codes after they are redeemed

Disables a Shopify code configured for one-time use after a customer redeems it.

Shopify discount-writing permission.

The maximum-one-code setting does not make an incompatible Shopify discount combinable. Shopify's own eligibility and combination rules still apply.

Customize customer text and errors

Use the translation action at the top of Discount Codes to edit the section title, action, input, instructions, confirmation, and loading messages for supported languages.

Under Discount code restrictions, select Edit messages to customize the error shown when Shopify rejects an app discount, basic code, buy-X-get-Y code, free-shipping code, or script discount. Keep the message useful without promising a reason Shopify has not returned.

What the customer experiences

  1. The customer opens an eligible order during the editing window.
  2. They enter a discount code from the discount-code block.
  3. Order Editing asks Shopify to validate the code against the current order.
  4. If the order total decreases, the customer reviews and accepts the partial refund.
  5. The saved order reflects the accepted discount and any revalidation result.

The code may still be rejected because of product, customer, market, usage, date, minimum-spend, or combination rules configured in Shopify.

Check the setup

  1. Create separate test codes for a valid case and a known ineligible case.
  2. Open an existing controlled paid order inside the editing window.
  3. Apply the valid code and confirm the refund amount is correct.
  4. Save the change, then confirm the discount and refund on the Shopify order.
  5. Try the ineligible code and confirm the customer receives the intended error.
  6. If revalidation is enabled, edit the order so an existing discount stops qualifying and confirm the warning appears before save.

If a code cannot be applied

  • Confirm order downgrades and a refund method are enabled.
  • Confirm the discount-code block is enabled and saved.
  • Check the code's eligibility and combination rules in Shopify.
  • Grant the discount-writing permission when using revalidation or one-time-code disabling.
  • Confirm the order is still editable and can receive the required partial refund.
  • Check whether Allow a maximum of one discount code per order is preventing the existing and new codes from being evaluated together.

Related articles

App Blocks

Setting Up Checkout Line Item Editing

Let customers adjust eligible checkout items before payment.

App Blocks

Shipping Address Edits

Let customers update shipping addresses and configure destination restrictions, tax handling, autocomplete, and validation rules.

App Blocks

Change Products

Let customers switch variants or replace products while editing an order.

App Blocks

Quantity Edits

Let customers increase, decrease, or remove product quantities and choose how partial refunds are issued when an order value falls.