Developers
Ask
Sign inSign in

Apply coupon code

How do I apply or remove a coupon on a campaign?

1 min readUpdated 15 November 2026
Short answer

dorna_apply_coupon applies a coupon code to an unpaid campaign's draft invoice, or removes it with remove set to true.

  • dorna_apply_coupon
  • Changes data
  • Asks before it runs
Contents
  1. Parameters
  2. What it returns
  3. Example
  4. Access and confirmation

Parameters

FieldTypeDescription
campaignIdstring (ID)Required. An unpaid campaign.
codestringThe coupon code.
removebooleantrue removes the coupon instead of applying it.

What it returns

The new totals in rials (10 rials = 1 toman). A campaign holds one coupon.

Example

Ask your assistant: Apply the code SPRING to my July campaign.

The assistant then calls the tool like this:

{
  "name": "dorna_apply_coupon",
  "arguments": {
    "campaignId": "64f1a2b3c4d5e6f7a8b9c0d1"
  }
}

A typical result looks like this (the values are examples):

{
  "invoiceId": "64f1a2b3c4d5e6f7a8b9c0d1",
  "invoiceNumber": "INV-1405-0042",
  "subtotalRials": 12000000,
  "discountRials": 1200000,
  "vatRials": 1080000,
  "totalRials": 11880000
}

Access and confirmation

Changes or deletes existing data. Your assistant asks you before every call.

This changes the draft invoice, so your assistant asks first.

Related tools: dorna_campaigns dorna_pay_campaign

Still have a question?

Open this guide in your own AI assistant and ask it.

ChatGPTClaudeGemini