> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://ordergroove.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ordergroove.ferndocs.com/_mcp/server.

# Update Coupons

PATCH https://restapi.ordergroove.com/offer_profiles/{offer_profile_id}/update_coupon/
Content-Type: application/json

Updates the associated initial or recurring coupon and discounts.

Reference: https://ordergroove.ferndocs.com/reference/rest-rpc-api/offer-profiles/offer-profile-update-coupons

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `offer_profile_id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `public_id` (string, required) — Unique Offer Profile ID
- `recurring_coupon` (OfferProfilesOfferProfileIdUpdateCouponPatchRequestBodyContentApplicationJsonSchemaRecurringCoupon, optional) — Recurring Coupon
- `initial coupon` (OfferProfilesOfferProfileIdUpdateCouponPatchRequestBodyContentApplicationJsonSchemaInitialCoupon, optional) — Initial Coupon

## Response

### 200

200

- `public_id` (string, optional)
- `recurring_coupon` (OfferProfilesOfferProfileIdUpdateCouponPatchResponsesContentApplicationJsonSchemaRecurringCoupon, optional)
- `initial_coupon` (OfferProfilesOfferProfileIdUpdateCouponPatchResponsesContentApplicationJsonSchemaInitialCoupon, optional)

## Errors

### 400 Bad Request Error

400

- `map from string to string`

### 403 Forbidden Error

403

- `detail` (string, optional)

### 404 Not Found Error

404

- `detail` (string, optional)

## Types

### OfferProfilesOfferProfileIdUpdateCouponPatchRequestBodyContentApplicationJsonSchemaRecurringCoupon

Recurring Coupon

- `public_id` (string, required) — Unique Recurring Coupon ID
- `name` (string, required) — Coupon name
- `code` (string, required) — Coupon code
- `discounts` (list of string, required) — List of all coupon discounts

### OfferProfilesOfferProfileIdUpdateCouponPatchRequestBodyContentApplicationJsonSchemaInitialCoupon

Initial Coupon

- `public_id` (string, required) — Unique Initial Coupon ID
- `name` (string, required) — Coupon name
- `code` (string, required) — Coupon code
- `discounts` (list of string, required) — List of all coupon discounts

### OfferProfilesOfferProfileIdUpdateCouponPatchResponsesContentApplicationJsonSchemaRecurringCoupon

- `public_id` (string, optional)
- `name` (string, optional)
- `code` (string, optional)
- `discounts` (list of OfferProfilesOfferProfileIdUpdateCouponPatchResponsesContentApplicationJsonSchemaRecurringCouponDiscountsItems, optional)

### OfferProfilesOfferProfileIdUpdateCouponPatchResponsesContentApplicationJsonSchemaInitialCoupon

- `public_id` (string, optional)
- `name` (string, optional)
- `code` (string, optional)
- `discounts` (list of OfferProfilesOfferProfileIdUpdateCouponPatchResponsesContentApplicationJsonSchemaInitialCouponDiscountsItems, optional)

### OfferProfilesOfferProfileIdUpdateCouponPatchResponsesContentApplicationJsonSchemaRecurringCouponDiscountsItems

- `public_id` (string, optional)
- `name` (string, optional)
- `object` (integer, optional, default: 0)
- `field` (integer, optional, default: 0)
- `type` (string, optional)
- `value` (string, optional)
- `threshold_field` (integer, optional, default: 0)
- `threshold_value` (string, optional)

### OfferProfilesOfferProfileIdUpdateCouponPatchResponsesContentApplicationJsonSchemaInitialCouponDiscountsItems

- `public_id` (string, optional)
- `name` (string, optional)
- `object` (integer, optional, default: 0)
- `field` (integer, optional, default: 0)
- `type` (string, optional)
- `value` (string, optional)
- `threshold_field` (integer, optional, default: 0)
- `threshold_value` (string, optional)

## Examples

**Request**

```json
{
  "public_id": "string"
}
```

**Response**

```json
{
  "public_id": "e3e9ac44a24f15e485b0bc764e107cf3",
  "recurring_coupon": {
    "public_id": "ff48e9fdc8eb4d79abd7c8c573523d25",
    "name": "Demo Store Incentives",
    "code": "demo_store",
    "discounts": [
      {
        "public_id": "c67dec11aedb4885aa9a58c3f89de746",
        "name": "Free shipping on orders over $50",
        "object": 1,
        "field": 2,
        "type": "Free discount_percent",
        "value": "100",
        "threshold_field": 3,
        "threshold_value": "50"
      }
    ]
  },
  "initial_coupon": {
    "public_id": "ff48e9fdc8eb4d79abd7c8c573523d25",
    "name": "Demo Store Incentives",
    "code": "demo_store",
    "discounts": [
      {
        "public_id": "c67dec11aedb4885aa9a58c3f89de746",
        "name": "Free shipping on orders over $50",
        "object": 1,
        "field": 2,
        "type": "Free discount_percent",
        "value": "100",
        "threshold_field": 3,
        "threshold_value": "50"
      }
    ]
  }
}
```

**SDK Code**

```python Result
import requests

url = "https://restapi.ordergroove.com/offer_profiles/offer_profile_id/update_coupon/"

payload = { "public_id": "string" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Result
const url = 'https://restapi.ordergroove.com/offer_profiles/offer_profile_id/update_coupon/';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"public_id":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Result
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://restapi.ordergroove.com/offer_profiles/offer_profile_id/update_coupon/"

	payload := strings.NewReader("{\n  \"public_id\": \"string\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Result
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/offer_profiles/offer_profile_id/update_coupon/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"public_id\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java Result
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://restapi.ordergroove.com/offer_profiles/offer_profile_id/update_coupon/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"public_id\": \"string\"\n}")
  .asString();
```

```php Result
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://restapi.ordergroove.com/offer_profiles/offer_profile_id/update_coupon/', [
  'body' => '{
  "public_id": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Result
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/offer_profiles/offer_profile_id/update_coupon/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"public_id\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Result
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["public_id": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/offer_profiles/offer_profile_id/update_coupon/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```