> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/coupons/add-coupon.md).

# Add coupon

Use the **addPromotionCoupon** method to add single or multiple coupons to a promotion. Using the **addPromotionCoupon** for a promotion that is set to apply automatically will change the promotion type to the manual flow, where customers are required to enter the coupon code to receive the discount.

## Request parameters

<table><thead><tr><th width="250.2667236328125">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><strong>Required (string)</strong><br>Output of the <strong>Login</strong> method.</td></tr><tr><td><code>promotionCode</code></td><td><strong>Required (string)</strong><br>The code corresponding to the promotion that you want to add coupons to.</td></tr><tr><td><code>promotionCoupon</code></td><td><strong>Required (object)</strong></td></tr><tr><td><code>promotionCoupon.type</code></td><td><p><strong>Required (string)</strong></p><p>Coupon type. Available values:</p><ul><li>SINGLE, use in conjunction with <code>Code</code></li><li>MULTIPLE, use in conjunction with <code>Codes</code></li></ul></td></tr><tr><td><code>promotionCoupon.Code/Codes</code></td><td><strong>Required (string / array of strings)</strong><br>Coupon code (for SINGLE) or array of coupon codes (for MULTIPLE).</td></tr></tbody></table>

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

// Promotion code corresponding to the promotion you want to add coupons to
$promotionCode = '';

// Define single coupon object
$promotionCoupon = new stdClass;
$promotionCoupon->Type = 'SINGLE';
$promotionCoupon->Code = 'YOUR_CODE_HERE';

// Define multiple coupon object
$promotionCoupon = new stdClass;
$promotionCoupon->Type = 'MULTIPLE';
$promotionCoupon->Codes = ['YOUR_CODE_1', 'YOUR_CODE_2'];

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'addPromotionCoupon',
'params' => array($sessionID, $promotionCode, $promotionCoupon)
);
var_dump (callRPC($jsonRpcRequest, $host));
```

## Response parameters

<table><thead><tr><th width="171.333251953125">Parameter</th><th>Type</th></tr></thead><tbody><tr><td><a href="/pages/d1cfbc99f415fd4153e045f9eba37aca5ff6431c"><code>promotionCoupon</code></a></td><td><strong>Object</strong></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/coupons/add-coupon.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
