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

# Update

PATCH https://restapi.ordergroove.com/one_time_incentives/{one_time_incentive_id}/update/
Content-Type: application/json

Updates an existing one-time incentive.

This endpoint accepts the Application API Scope only. Storefront API Scope signatures are rejected.

Reference: https://developer.ordergroove.com/reference/rest-rpc-api/one-time-incentives/otd-update

## Authentication

- `x-api-key` header (required) — Application API Scope — server-to-server, sent in the `x-api-key` header. See [Authentication](/api-reference/authentication).

## Request

### Path parameters

- `one_time_incentive_id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `external_code` (string, optional) — External Code
- `description` (string, optional) — Description
- `order` (string, optional) — Order ID
- `item` (string, optional) — Item ID
- `incentive` (OneTimeIncentivesOneTimeIncentiveIdUpdatePatchRequestBodyContentApplicationJsonSchemaIncentive, optional) — Incentive Object

## Response

### 200

200

- `public_id` (string, optional)
- `external_code` (string, optional)
- `description` (string, optional)
- `merchant` (string, optional)
- `customer` (string, optional)
- `order` (string, optional)
- `created` (string, optional)
- `last_updated` (string, optional)
- `incentive` (OneTimeIncentivesOneTimeIncentiveIdUpdatePatchResponsesContentApplicationJsonSchemaIncentive, optional)

## Errors

### 400 Bad Request Error

400

- `[field_name]` (string, optional)

## Types

### OneTimeIncentivesOneTimeIncentiveIdUpdatePatchRequestBodyContentApplicationJsonSchemaIncentive

Incentive Object

- `discount_type` (string, optional) — For discount incentives. Choose 'Discount Percent' for a percent off discount or 'Discount Amount' for a flat dollar off discount.
- `target` (string, optional) — If you're applying a order target discount you can choose from 'subtotal' or 'shipping_total' for all item target discounts send 'total_price'
- `name` (string, optional) — Anything to help identify this incentive
- `value` (string, optional) — For discount incentives. The value of the discount eg 5 for $5off or 10 for 10%off
- `product` (string, optional) — For gift incentives. External product id for the gift product.
- `threshold_field` (string, optional) — For discount incentives. Names the field checked against `threshold_value` before the discount applies, and must pair with `target` the same way `field` does: 'total_price' for `target: "item"`, 'sub_total' or 'shipping_total' for `target: "order"`. An invalid pairing returns `400`.
- `threshold_value` (string, optional) — For discount incentives. The minimum value `threshold_field` must reach for the discount to apply. Send with `threshold_field`.
- `limit_policy` (enum, optional) — For discount incentives. How `limit_value` is interpreted when capping the discount. Only `fixed` is supported, which reads `limit_value` as a flat amount. Send with `limit_value`; sending either field without the other returns `400`. Leave both out to keep an existing limit unchanged.
  - Allowed values: `fixed`
- `limit_value` (string, optional) — For discount incentives. Caps the discount a single application can produce, interpreted according to `limit_policy`. The cap applies per application: per item for `target: "item"`, per order for `target: "order"`. Must be non-negative. Send with `limit_policy`; sending either field without the other returns `400`. Leave both out to keep an existing limit unchanged.

### OneTimeIncentivesOneTimeIncentiveIdUpdatePatchResponsesContentApplicationJsonSchemaIncentive

- `type` (string, optional)
- `public_id` (string, optional)
- `discount_type` (string, optional)
- `target` (string, optional)
- `field` (string, optional)
- `name` (string, optional)
- `value` (string, optional)
- `limit_value` (string, optional) — Cap on the discount a single application can produce. Omitted when no limit is configured.
- `limit_policy` (enum, optional) — How `limit_value` is interpreted. Omitted when no limit is configured.
  - Allowed values: `fixed`

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "public_id": "8637c3fe9b7011eaa2c1bc764e107990",
  "external_code": "awesome_discount",
  "description": "One-time Incentive",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "order": "c4e05d04ccc411e8ada3bc764e101db1",
  "created": "2020-05-21 09:36:57",
  "last_updated": "2020-05-21 09:36:57",
  "incentive": {
    "type": "Discount",
    "public_id": "c34a8c03eae641d0ab7015bedec6fbd0",
    "discount_type": "Discount Percent",
    "target": "item",
    "field": "total_price",
    "name": "awesome discount",
    "value": "10.00"
  }
}
```

**SDK Code**

```python Result
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/one_time_incentive_id/update/"

payload = {}
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/one_time_incentives/one_time_incentive_id/update/';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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/one_time_incentives/one_time_incentive_id/update/"

	payload := strings.NewReader("{}")

	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/one_time_incentives/one_time_incentive_id/update/")

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 = "{}"

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/one_time_incentives/one_time_incentive_id/update/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://restapi.ordergroove.com/one_time_incentives/one_time_incentive_id/update/', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Result
using RestSharp;

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

```swift Result
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/one_time_incentive_id/update/")! 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()
```