> 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.

# Create

POST https://restapi.ordergroove.com/one_time_incentives/create/
Content-Type: application/json

Creates a one-time discount and attaches it to a specific item, order, or shipping rate for an individual customer.

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-create

## 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

### Body (application/json)

This endpoint expects an object.

- `merchant` (string, required) — Merchant ID
- `customer` (string, required) — Customer ID
- `description` (string, optional) — Description
- `expires` (date, optional) — Date by which Order Must Place to Apply discount
- `item` (string, optional) — Send Item ID to apply a One Time Incentive to a specific item. This field and `order` are mutually exclusive, but one is required.
- `order` (string, optional) — Send Order ID to apply a One Time Incentive to a specific order. This field and `item` are mutually exclusive, but one is required.
- `stacking_type` (string, optional, default: base) — Choose 'base' or 'additional' for a standard discount or an additive one (defaults to 'base')
- `external_code` (string, optional) — External Code
- `incentive` (OneTimeIncentivesCreatePostRequestBodyContentApplicationJsonSchemaIncentive, optional) — Incentive Object. `type` selects the shape: send `Discount` for a discount incentive or `Gift` to add a free product. The remaining fields differ between the two.

## Response

### 201

201

- `One-Time Incentives_otd-create_Response_201`

## Errors

### 400 Bad Request Error

400

- `[field_name]` (string, optional)

## Types

### OneTimeIncentivesCreatePostRequestBodyContentApplicationJsonSchemaIncentive

Incentive Object. `type` selects the shape: send `Discount` for a discount incentive or `Gift` to add a free product. The remaining fields differ between the two.

### One Time Item Discount

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

### One Time Order Total Discount

- `public_id` (string, optional)
- `external_code` (string, optional)
- `description` (string, optional)
- `customer` (string, optional)
- `merchant` (string, optional)
- `order` (string, optional)
- `incentive` (OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf1Incentive, optional)
- `created` (string, optional)
- `last_updated` (string, optional)
- `expires` (string, optional)
- `stacking_type` (string, optional)
- `item` (any, optional)

### One Time Order Shipping Discount

- `public_id` (string, optional)
- `external_code` (string, optional)
- `description` (string, optional)
- `customer` (string, optional)
- `merchant` (string, optional)
- `order` (string, optional)
- `incentive` (OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf2Incentive, optional)
- `created` (string, optional)
- `last_updated` (string, optional)
- `expires` (string, optional)
- `stacking_type` (string, optional)
- `item` (any, optional)

### One Time Order Total Discount (With Threshold)

- `public_id` (string, optional)
- `external_code` (string, optional)
- `description` (string, optional)
- `customer` (string, optional)
- `merchant` (string, optional)
- `order` (string, optional)
- `incentive` (OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf3Incentive, optional)
- `created` (string, optional)
- `last_updated` (string, optional)
- `expires` (string, optional)
- `stacking_type` (string, optional)
- `item` (any, optional)

### One Time All Order Items Discount

- `public_id` (string, optional)
- `external_code` (string, optional)
- `description` (string, optional)
- `customer` (string, optional)
- `merchant` (string, optional)
- `order` (string, optional)
- `incentive` (OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf4Incentive, optional)
- `created` (string, optional)
- `last_updated` (string, optional)
- `expires` (string, optional)
- `stacking_type` (string, optional)
- `item` (any, optional)

### Discount

- `type` (enum, required) — Must send 'Discount'
  - Allowed values: `Discount`
- `name` (string, required) — Anything to help identify this incentive
- `discount_type` (string, required) — Choose 'Discount Percent' for a percent off discount or 'Discount Amount' for a flat dollar off discount.
- `value` (string, required) — The value of the discount eg 5 for $5 off or 10 for 10% off
- `field` (string, required) — If using `target: "item"`, field should be 'total_price'. If using `target: "order"`, field should be 'sub_total' or 'shipping_total'.
- `target` (string, required) — If an Order ID (`order: <Order ID>`) was provided the `target` can be 'item' or 'order'. If an Item ID ((`item: <Item ID>`) was provided `target` must be 'item'.
- `threshold_field` (string, optional) — Optional minimum the target must reach before the discount applies. Names the field checked against `threshold_value`, 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`. Send with `threshold_value`; a threshold with only one of the two set is ignored.
- `threshold_value` (string, optional) — The minimum value `threshold_field` must reach for the discount to apply. The discount is skipped for any target below it. Send with `threshold_field`.
- `limit_policy` (enum, optional) — 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`.
  - Allowed values: `fixed`
- `limit_value` (string, optional) — 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"`. For `discount_type: "Discount Amount"` on an item, `value` is multiplied by the item quantity before the cap applies, so `value: "5.00"` with `limit_value: "10.00"` discounts $10 on a quantity of 3 rather than $15. Must be non-negative. Send with `limit_policy`; sending either field without the other returns `400`.

### Gift

- `type` (enum, required) — Must send 'Gift'
  - Allowed values: `Gift`
- `name` (string, required) — Anything to help identify this incentive
- `product` (string, required) — External product id of the product to give away.
- `target` (enum, required) — Must be 'item'. A gift can only be attached to an item, so send the gift with an Item ID (`item: <Item ID>`) rather than an Order ID; anything else returns `400`.
  - Allowed values: `item`

### OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf0Incentive

- `type` (string, optional)
- `public_id` (string, optional)
- `discount_type` (string, optional)
- `target` (string, optional)
- `field` (string, optional)
- `name` (string, optional)
- `value` (string, optional)
- `threshold_field` (any, optional)
- `threshold_value` (any, 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`

### OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf1Incentive

- `name` (string, optional)
- `public_id` (string, optional)
- `type` (string, optional)
- `field` (string, optional)
- `discount_type` (string, optional)
- `value` (string, optional)
- `threshold_field` (any, optional)
- `threshold_value` (any, optional)
- `target` (string, optional)

### OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf2Incentive

- `name` (string, optional)
- `public_id` (string, optional)
- `type` (string, optional)
- `field` (string, optional)
- `discount_type` (string, optional)
- `value` (string, optional)
- `threshold_field` (any, optional)
- `threshold_value` (any, optional)
- `target` (string, optional)

### OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf3Incentive

- `name` (string, optional)
- `public_id` (string, optional)
- `type` (string, optional)
- `field` (string, optional)
- `discount_type` (string, optional)
- `value` (string, optional)
- `threshold_field` (string, optional)
- `threshold_value` (string, optional)
- `target` (string, optional)

### OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf4Incentive

- `name` (string, optional)
- `public_id` (string, optional)
- `type` (string, optional)
- `field` (string, optional)
- `discount_type` (string, optional)
- `value` (string, optional)
- `threshold_field` (any, optional)
- `threshold_value` (any, optional)
- `target` (string, optional)

## Examples

### One Time Item Discount

**Request**

```json
undefined
```

**Response**

```json
{
  "public_id": "8637c3fe9b7011eaa2c1bc764e107990",
  "external_code": "one_time_item_discount",
  "description": "One-Time Item Incentive",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "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": "One Time Item Discount",
    "value": "75.00"
  }
}
```

**SDK Code**

```python One Time Item Discount
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/create/"

headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript One Time Item Discount
const url = 'https://restapi.ordergroove.com/one_time_incentives/create/';
const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

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

```go One Time Item Discount
package main

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

func main() {

	url := "https://restapi.ordergroove.com/one_time_incentives/create/"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby One Time Item Discount
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/one_time_incentives/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'

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

```java One Time Item Discount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/one_time_incentives/create/")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php One Time Item Discount
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/one_time_incentives/create/', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp One Time Item Discount
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/one_time_incentives/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift One Time Item Discount
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### One Time Order Total Discount

**Request**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Total Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "base",
  "external_code": "one_time_order_total_discount",
  "incentive": {
    "type": "Discount",
    "name": "One-Time Order Total Discount",
    "discount_type": "Discount Amount",
    "value": "25.00",
    "field": "sub_total",
    "target": "order"
  }
}
```

**Response**

```json
{
  "public_id": "52df97b4f0fa11eeafd33e19316267db",
  "external_code": "one_time_order_total_discount",
  "description": "One-Time Order Total Discount",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "created": "2024-04-02 09:07:21",
  "last_updated": "2024-04-02 09:07:21",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "incentive": {
    "type": "Discount",
    "public_id": "a8cf39af36e14bdabb1a397360883096",
    "discount_type": "Discount Amount",
    "target": "order",
    "field": "sub_total",
    "name": "One Time Order Total Discount",
    "value": "25.00"
  },
  "expires": "2024-05-21 00:00:00",
  "stacking_type": "base"
}
```

**SDK Code**

```python One Time Order Total Discount
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/create/"

payload = {
    "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
    "customer": "00026001",
    "description": "One-Time Order Total Discount",
    "expires": "2024-05-21 00:00:00",
    "order": "a4f656f6ed4511eebfaf6a353c182723",
    "stacking_type": "base",
    "external_code": "one_time_order_total_discount",
    "incentive": {
        "type": "Discount",
        "name": "One-Time Order Total Discount",
        "discount_type": "Discount Amount",
        "value": "25.00",
        "field": "sub_total",
        "target": "order"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript One Time Order Total Discount
const url = 'https://restapi.ordergroove.com/one_time_incentives/create/';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"merchant":"ac4f7938383a11e89ecbbc764e1107f2","customer":"00026001","description":"One-Time Order Total Discount","expires":"2024-05-21 00:00:00","order":"a4f656f6ed4511eebfaf6a353c182723","stacking_type":"base","external_code":"one_time_order_total_discount","incentive":{"type":"Discount","name":"One-Time Order Total Discount","discount_type":"Discount Amount","value":"25.00","field":"sub_total","target":"order"}}'
};

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

```go One Time Order Total Discount
package main

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

func main() {

	url := "https://restapi.ordergroove.com/one_time_incentives/create/"

	payload := strings.NewReader("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Total Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"base\",\n  \"external_code\": \"one_time_order_total_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Order Total Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"25.00\",\n    \"field\": \"sub_total\",\n    \"target\": \"order\"\n  }\n}")

	req, _ := http.NewRequest("POST", 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 One Time Order Total Discount
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/one_time_incentives/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Total Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"base\",\n  \"external_code\": \"one_time_order_total_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Order Total Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"25.00\",\n    \"field\": \"sub_total\",\n    \"target\": \"order\"\n  }\n}"

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

```java One Time Order Total Discount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/one_time_incentives/create/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Total Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"base\",\n  \"external_code\": \"one_time_order_total_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Order Total Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"25.00\",\n    \"field\": \"sub_total\",\n    \"target\": \"order\"\n  }\n}")
  .asString();
```

```php One Time Order Total Discount
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/one_time_incentives/create/', [
  'body' => '{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Total Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "base",
  "external_code": "one_time_order_total_discount",
  "incentive": {
    "type": "Discount",
    "name": "One-Time Order Total Discount",
    "discount_type": "Discount Amount",
    "value": "25.00",
    "field": "sub_total",
    "target": "order"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp One Time Order Total Discount
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/one_time_incentives/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Total Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"base\",\n  \"external_code\": \"one_time_order_total_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Order Total Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"25.00\",\n    \"field\": \"sub_total\",\n    \"target\": \"order\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift One Time Order Total Discount
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Total Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "base",
  "external_code": "one_time_order_total_discount",
  "incentive": [
    "type": "Discount",
    "name": "One-Time Order Total Discount",
    "discount_type": "Discount Amount",
    "value": "25.00",
    "field": "sub_total",
    "target": "order"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### One Time Order Shipping Discount

**Request**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Shipping Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "base",
  "external_code": "one_time_order_shipping_discount",
  "incentive": {
    "type": "Discount",
    "name": "One Time Order Shipping Discount",
    "discount_type": "Discount Amount",
    "value": "4.50",
    "field": "shipping_total",
    "target": "order"
  }
}
```

**Response**

```json
{
  "public_id": "0af4c838f0fc21eebef47a8c9392aaf4",
  "external_code": "one_time_order_shipping_discount",
  "description": "One-Time Order Shipping Discount",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "created": "2024-04-02 09:19:40",
  "last_updated": "2024-04-02 09:19:40",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "incentive": {
    "type": "Discount",
    "public_id": "f3b7b52a06b842ae9e47f92d168a92e1",
    "discount_type": "Discount Amount",
    "target": "order",
    "field": "shipping_total",
    "name": "One Time Order Shipping Discount",
    "value": "4.50"
  },
  "expires": "2024-05-21 00:00:00",
  "stacking_type": "base"
}
```

**SDK Code**

```python One Time Order Shipping Discount
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/create/"

payload = {
    "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
    "customer": "00026001",
    "description": "One-Time Order Shipping Discount",
    "expires": "2024-05-21 00:00:00",
    "order": "a4f656f6ed4511eebfaf6a353c182723",
    "stacking_type": "base",
    "external_code": "one_time_order_shipping_discount",
    "incentive": {
        "type": "Discount",
        "name": "One Time Order Shipping Discount",
        "discount_type": "Discount Amount",
        "value": "4.50",
        "field": "shipping_total",
        "target": "order"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript One Time Order Shipping Discount
const url = 'https://restapi.ordergroove.com/one_time_incentives/create/';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"merchant":"ac4f7938383a11e89ecbbc764e1107f2","customer":"00026001","description":"One-Time Order Shipping Discount","expires":"2024-05-21 00:00:00","order":"a4f656f6ed4511eebfaf6a353c182723","stacking_type":"base","external_code":"one_time_order_shipping_discount","incentive":{"type":"Discount","name":"One Time Order Shipping Discount","discount_type":"Discount Amount","value":"4.50","field":"shipping_total","target":"order"}}'
};

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

```go One Time Order Shipping Discount
package main

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

func main() {

	url := "https://restapi.ordergroove.com/one_time_incentives/create/"

	payload := strings.NewReader("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Shipping Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"base\",\n  \"external_code\": \"one_time_order_shipping_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One Time Order Shipping Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"4.50\",\n    \"field\": \"shipping_total\",\n    \"target\": \"order\"\n  }\n}")

	req, _ := http.NewRequest("POST", 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 One Time Order Shipping Discount
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/one_time_incentives/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Shipping Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"base\",\n  \"external_code\": \"one_time_order_shipping_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One Time Order Shipping Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"4.50\",\n    \"field\": \"shipping_total\",\n    \"target\": \"order\"\n  }\n}"

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

```java One Time Order Shipping Discount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/one_time_incentives/create/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Shipping Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"base\",\n  \"external_code\": \"one_time_order_shipping_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One Time Order Shipping Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"4.50\",\n    \"field\": \"shipping_total\",\n    \"target\": \"order\"\n  }\n}")
  .asString();
```

```php One Time Order Shipping Discount
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/one_time_incentives/create/', [
  'body' => '{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Shipping Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "base",
  "external_code": "one_time_order_shipping_discount",
  "incentive": {
    "type": "Discount",
    "name": "One Time Order Shipping Discount",
    "discount_type": "Discount Amount",
    "value": "4.50",
    "field": "shipping_total",
    "target": "order"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp One Time Order Shipping Discount
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/one_time_incentives/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Shipping Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"base\",\n  \"external_code\": \"one_time_order_shipping_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One Time Order Shipping Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"4.50\",\n    \"field\": \"shipping_total\",\n    \"target\": \"order\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift One Time Order Shipping Discount
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Shipping Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "base",
  "external_code": "one_time_order_shipping_discount",
  "incentive": [
    "type": "Discount",
    "name": "One Time Order Shipping Discount",
    "discount_type": "Discount Amount",
    "value": "4.50",
    "field": "shipping_total",
    "target": "order"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### One Time Order Total Discount (With Threshold)

**Request**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Discount With Threshold",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_order_discount_with_threshold",
  "incentive": {
    "type": "Discount",
    "name": "One-Time Order Discount With Threshold",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "sub_total",
    "target": "order",
    "threshold_field": "sub_total",
    "threshold_value": "20.00"
  }
}
```

**Response**

```json
{
  "public_id": "37148f0af0fd11ee951baeb47e6cdae4",
  "external_code": "one_time_order_discount_with_threshold",
  "description": "One-Time Order Discount With Threshold",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "created": "2024-04-02 09:28:03",
  "last_updated": "2024-04-02 09:28:03",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "incentive": {
    "type": "Discount",
    "public_id": "8047168c9ab04bfcb463ce9636464a73",
    "discount_type": "Discount Percent",
    "target": "order",
    "field": "sub_total",
    "name": "One-Time Order Discount With Threshold",
    "value": "75.00",
    "threshold_field": "sub_total",
    "threshold_value": "20.00"
  },
  "expires": "2024-05-21 00:00:00",
  "stacking_type": "additional"
}
```

**SDK Code**

```python One Time Order Total Discount (With Threshold)
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/create/"

payload = {
    "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
    "customer": "00026001",
    "description": "One-Time Order Discount With Threshold",
    "expires": "2024-05-21 00:00:00",
    "order": "a4f656f6ed4511eebfaf6a353c182723",
    "stacking_type": "additional",
    "external_code": "one_time_order_discount_with_threshold",
    "incentive": {
        "type": "Discount",
        "name": "One-Time Order Discount With Threshold",
        "discount_type": "Discount Percent",
        "value": "75.00",
        "field": "sub_total",
        "target": "order",
        "threshold_field": "sub_total",
        "threshold_value": "20.00"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript One Time Order Total Discount (With Threshold)
const url = 'https://restapi.ordergroove.com/one_time_incentives/create/';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"merchant":"ac4f7938383a11e89ecbbc764e1107f2","customer":"00026001","description":"One-Time Order Discount With Threshold","expires":"2024-05-21 00:00:00","order":"a4f656f6ed4511eebfaf6a353c182723","stacking_type":"additional","external_code":"one_time_order_discount_with_threshold","incentive":{"type":"Discount","name":"One-Time Order Discount With Threshold","discount_type":"Discount Percent","value":"75.00","field":"sub_total","target":"order","threshold_field":"sub_total","threshold_value":"20.00"}}'
};

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

```go One Time Order Total Discount (With Threshold)
package main

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

func main() {

	url := "https://restapi.ordergroove.com/one_time_incentives/create/"

	payload := strings.NewReader("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Discount With Threshold\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_order_discount_with_threshold\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Order Discount With Threshold\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"sub_total\",\n    \"target\": \"order\",\n    \"threshold_field\": \"sub_total\",\n    \"threshold_value\": \"20.00\"\n  }\n}")

	req, _ := http.NewRequest("POST", 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 One Time Order Total Discount (With Threshold)
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/one_time_incentives/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Discount With Threshold\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_order_discount_with_threshold\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Order Discount With Threshold\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"sub_total\",\n    \"target\": \"order\",\n    \"threshold_field\": \"sub_total\",\n    \"threshold_value\": \"20.00\"\n  }\n}"

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

```java One Time Order Total Discount (With Threshold)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/one_time_incentives/create/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Discount With Threshold\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_order_discount_with_threshold\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Order Discount With Threshold\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"sub_total\",\n    \"target\": \"order\",\n    \"threshold_field\": \"sub_total\",\n    \"threshold_value\": \"20.00\"\n  }\n}")
  .asString();
```

```php One Time Order Total Discount (With Threshold)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/one_time_incentives/create/', [
  'body' => '{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Discount With Threshold",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_order_discount_with_threshold",
  "incentive": {
    "type": "Discount",
    "name": "One-Time Order Discount With Threshold",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "sub_total",
    "target": "order",
    "threshold_field": "sub_total",
    "threshold_value": "20.00"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp One Time Order Total Discount (With Threshold)
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/one_time_incentives/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Order Discount With Threshold\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_order_discount_with_threshold\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Order Discount With Threshold\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"sub_total\",\n    \"target\": \"order\",\n    \"threshold_field\": \"sub_total\",\n    \"threshold_value\": \"20.00\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift One Time Order Total Discount (With Threshold)
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Order Discount With Threshold",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_order_discount_with_threshold",
  "incentive": [
    "type": "Discount",
    "name": "One-Time Order Discount With Threshold",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "sub_total",
    "target": "order",
    "threshold_field": "sub_total",
    "threshold_value": "20.00"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### One Time All Order Items Discount

**Request**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time All Order Items Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_all_order_items_discount",
  "incentive": {
    "type": "Discount",
    "name": "One-Time All Order Items Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "target": "item"
  }
}
```

**Response**

```json
{
  "public_id": "e6d8feb0f10811eeb1c54af3e03516f1",
  "external_code": "one_time_all_order_items_discount",
  "description": "One-Time All Order Items Discount",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "created": "2024-04-02 10:51:43",
  "last_updated": "2024-04-02 10:51:43",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "incentive": {
    "type": "Discount",
    "public_id": "d7163fc5629b4e109b2c96d0f952393f",
    "discount_type": "Discount Percent",
    "target": "item",
    "field": "total_price",
    "name": "One-Time All Order Items Discount",
    "value": "75.00"
  },
  "expires": "2024-05-21 00:00:00",
  "stacking_type": "additional"
}
```

**SDK Code**

```python One Time All Order Items Discount
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/create/"

payload = {
    "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
    "customer": "00026001",
    "description": "One-Time All Order Items Discount",
    "expires": "2024-05-21 00:00:00",
    "order": "a4f656f6ed4511eebfaf6a353c182723",
    "stacking_type": "additional",
    "external_code": "one_time_all_order_items_discount",
    "incentive": {
        "type": "Discount",
        "name": "One-Time All Order Items Discount",
        "discount_type": "Discount Percent",
        "value": "75.00",
        "field": "total_price",
        "target": "item"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript One Time All Order Items Discount
const url = 'https://restapi.ordergroove.com/one_time_incentives/create/';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"merchant":"ac4f7938383a11e89ecbbc764e1107f2","customer":"00026001","description":"One-Time All Order Items Discount","expires":"2024-05-21 00:00:00","order":"a4f656f6ed4511eebfaf6a353c182723","stacking_type":"additional","external_code":"one_time_all_order_items_discount","incentive":{"type":"Discount","name":"One-Time All Order Items Discount","discount_type":"Discount Percent","value":"75.00","field":"total_price","target":"item"}}'
};

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

```go One Time All Order Items Discount
package main

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

func main() {

	url := "https://restapi.ordergroove.com/one_time_incentives/create/"

	payload := strings.NewReader("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time All Order Items Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_all_order_items_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\"\n  }\n}")

	req, _ := http.NewRequest("POST", 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 One Time All Order Items Discount
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/one_time_incentives/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time All Order Items Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_all_order_items_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\"\n  }\n}"

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

```java One Time All Order Items Discount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/one_time_incentives/create/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time All Order Items Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_all_order_items_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\"\n  }\n}")
  .asString();
```

```php One Time All Order Items Discount
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/one_time_incentives/create/', [
  'body' => '{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time All Order Items Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_all_order_items_discount",
  "incentive": {
    "type": "Discount",
    "name": "One-Time All Order Items Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "target": "item"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp One Time All Order Items Discount
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/one_time_incentives/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time All Order Items Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"order\": \"a4f656f6ed4511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_all_order_items_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift One Time All Order Items Discount
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time All Order Items Discount",
  "expires": "2024-05-21 00:00:00",
  "order": "a4f656f6ed4511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_all_order_items_discount",
  "incentive": [
    "type": "Discount",
    "name": "One-Time All Order Items Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "target": "item"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### One Time Item Discount (With Limit)

**Request**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Item Discount With Limit",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_item_discount_with_limit",
  "incentive": {
    "type": "Discount",
    "name": "One-Time Item Discount With Limit",
    "discount_type": "Discount Amount",
    "value": "5.00",
    "field": "total_price",
    "target": "item",
    "limit_policy": "fixed",
    "limit_value": "10.00"
  }
}
```

**Response**

```json
{
  "public_id": "3f19c7c0f2a411ee9c0d5e2b7b9d4c11",
  "external_code": "one_time_item_discount_with_limit",
  "description": "One-Time Item Discount With Limit",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "created": "2024-04-02 09:07:21",
  "last_updated": "2024-04-02 09:07:21",
  "incentive": {
    "type": "Discount",
    "public_id": "b21f5d7a4c8e4f1c9a6d3e8f7b2c5a90",
    "discount_type": "Discount Amount",
    "target": "item",
    "field": "total_price",
    "name": "One-Time Item Discount With Limit",
    "value": "5.00",
    "limit_value": "10.00",
    "limit_policy": "fixed"
  },
  "expires": "2024-05-21 00:00:00",
  "stacking_type": "additional"
}
```

**SDK Code**

```python One Time Item Discount (With Limit)
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/create/"

payload = {
    "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
    "customer": "00026001",
    "description": "One-Time Item Discount With Limit",
    "expires": "2024-05-21 00:00:00",
    "item": "a6f7305aed3511eebfaf6a353c182723",
    "stacking_type": "additional",
    "external_code": "one_time_item_discount_with_limit",
    "incentive": {
        "type": "Discount",
        "name": "One-Time Item Discount With Limit",
        "discount_type": "Discount Amount",
        "value": "5.00",
        "field": "total_price",
        "target": "item",
        "limit_policy": "fixed",
        "limit_value": "10.00"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript One Time Item Discount (With Limit)
const url = 'https://restapi.ordergroove.com/one_time_incentives/create/';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"merchant":"ac4f7938383a11e89ecbbc764e1107f2","customer":"00026001","description":"One-Time Item Discount With Limit","expires":"2024-05-21 00:00:00","item":"a6f7305aed3511eebfaf6a353c182723","stacking_type":"additional","external_code":"one_time_item_discount_with_limit","incentive":{"type":"Discount","name":"One-Time Item Discount With Limit","discount_type":"Discount Amount","value":"5.00","field":"total_price","target":"item","limit_policy":"fixed","limit_value":"10.00"}}'
};

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

```go One Time Item Discount (With Limit)
package main

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

func main() {

	url := "https://restapi.ordergroove.com/one_time_incentives/create/"

	payload := strings.NewReader("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Item Discount With Limit\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_item_discount_with_limit\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Item Discount With Limit\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"5.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\",\n    \"limit_policy\": \"fixed\",\n    \"limit_value\": \"10.00\"\n  }\n}")

	req, _ := http.NewRequest("POST", 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 One Time Item Discount (With Limit)
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/one_time_incentives/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Item Discount With Limit\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_item_discount_with_limit\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Item Discount With Limit\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"5.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\",\n    \"limit_policy\": \"fixed\",\n    \"limit_value\": \"10.00\"\n  }\n}"

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

```java One Time Item Discount (With Limit)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/one_time_incentives/create/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Item Discount With Limit\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_item_discount_with_limit\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Item Discount With Limit\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"5.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\",\n    \"limit_policy\": \"fixed\",\n    \"limit_value\": \"10.00\"\n  }\n}")
  .asString();
```

```php One Time Item Discount (With Limit)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/one_time_incentives/create/', [
  'body' => '{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Item Discount With Limit",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_item_discount_with_limit",
  "incentive": {
    "type": "Discount",
    "name": "One-Time Item Discount With Limit",
    "discount_type": "Discount Amount",
    "value": "5.00",
    "field": "total_price",
    "target": "item",
    "limit_policy": "fixed",
    "limit_value": "10.00"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp One Time Item Discount (With Limit)
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/one_time_incentives/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Item Discount With Limit\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_item_discount_with_limit\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Item Discount With Limit\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"5.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\",\n    \"limit_policy\": \"fixed\",\n    \"limit_value\": \"10.00\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift One Time Item Discount (With Limit)
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Item Discount With Limit",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_item_discount_with_limit",
  "incentive": [
    "type": "Discount",
    "name": "One-Time Item Discount With Limit",
    "discount_type": "Discount Amount",
    "value": "5.00",
    "field": "total_price",
    "target": "item",
    "limit_policy": "fixed",
    "limit_value": "10.00"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### One Time Gift

**Request**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time gift",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_gift_incentive",
  "incentive": {
    "type": "Gift",
    "name": "One-Time All Order Items Discount",
    "product": "43929919127725",
    "target": "item"
  }
}
```

**Response**

```json
{
  "public_id": "8637c3fe9b7011eaa2c1bc764e107990",
  "external_code": "one_time_gift_incentive",
  "description": "One-Time gift",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "created": "2020-05-21 09:36:57",
  "last_updated": "2020-05-21 09:36:57",
  "incentive": {
    "type": "Gift",
    "public_id": "c34a8c03eae641d0ab7015bedec6fbd0",
    "target": "item",
    "product": "43929919127725"
  }
}
```

**SDK Code**

```python One Time Gift
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/create/"

payload = {
    "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
    "customer": "00026001",
    "description": "One-Time gift",
    "expires": "2024-05-21 00:00:00",
    "item": "a6f7305aed3511eebfaf6a353c182723",
    "stacking_type": "additional",
    "external_code": "one_time_gift_incentive",
    "incentive": {
        "type": "Gift",
        "name": "One-Time All Order Items Discount",
        "product": "43929919127725",
        "target": "item"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript One Time Gift
const url = 'https://restapi.ordergroove.com/one_time_incentives/create/';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"merchant":"ac4f7938383a11e89ecbbc764e1107f2","customer":"00026001","description":"One-Time gift","expires":"2024-05-21 00:00:00","item":"a6f7305aed3511eebfaf6a353c182723","stacking_type":"additional","external_code":"one_time_gift_incentive","incentive":{"type":"Gift","name":"One-Time All Order Items Discount","product":"43929919127725","target":"item"}}'
};

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

```go One Time Gift
package main

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

func main() {

	url := "https://restapi.ordergroove.com/one_time_incentives/create/"

	payload := strings.NewReader("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time gift\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_gift_incentive\",\n  \"incentive\": {\n    \"type\": \"Gift\",\n    \"name\": \"One-Time All Order Items Discount\",\n    \"product\": \"43929919127725\",\n    \"target\": \"item\"\n  }\n}")

	req, _ := http.NewRequest("POST", 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 One Time Gift
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/one_time_incentives/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time gift\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_gift_incentive\",\n  \"incentive\": {\n    \"type\": \"Gift\",\n    \"name\": \"One-Time All Order Items Discount\",\n    \"product\": \"43929919127725\",\n    \"target\": \"item\"\n  }\n}"

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

```java One Time Gift
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/one_time_incentives/create/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time gift\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_gift_incentive\",\n  \"incentive\": {\n    \"type\": \"Gift\",\n    \"name\": \"One-Time All Order Items Discount\",\n    \"product\": \"43929919127725\",\n    \"target\": \"item\"\n  }\n}")
  .asString();
```

```php One Time Gift
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/one_time_incentives/create/', [
  'body' => '{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time gift",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_gift_incentive",
  "incentive": {
    "type": "Gift",
    "name": "One-Time All Order Items Discount",
    "product": "43929919127725",
    "target": "item"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp One Time Gift
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/one_time_incentives/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time gift\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_gift_incentive\",\n  \"incentive\": {\n    \"type\": \"Gift\",\n    \"name\": \"One-Time All Order Items Discount\",\n    \"product\": \"43929919127725\",\n    \"target\": \"item\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift One Time Gift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time gift",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_gift_incentive",
  "incentive": [
    "type": "Gift",
    "name": "One-Time All Order Items Discount",
    "product": "43929919127725",
    "target": "item"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### One Time Individual Item Discount

**Request**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Item Discount",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_item_discount",
  "incentive": {
    "type": "Discount",
    "name": "One-Time Item Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "target": "item"
  }
}
```

**Response**

```json
{
  "public_id": "8637c3fe9b7011eaa2c1bc764e107990",
  "external_code": "one_time_item_discount",
  "description": "One-Time Item Incentive",
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "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": "One Time Item Discount",
    "value": "75.00"
  }
}
```

**SDK Code**

```python One Time Individual Item Discount
import requests

url = "https://restapi.ordergroove.com/one_time_incentives/create/"

payload = {
    "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
    "customer": "00026001",
    "description": "One-Time Item Discount",
    "expires": "2024-05-21 00:00:00",
    "item": "a6f7305aed3511eebfaf6a353c182723",
    "stacking_type": "additional",
    "external_code": "one_time_item_discount",
    "incentive": {
        "type": "Discount",
        "name": "One-Time Item Discount",
        "discount_type": "Discount Percent",
        "value": "75.00",
        "field": "total_price",
        "target": "item"
    }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript One Time Individual Item Discount
const url = 'https://restapi.ordergroove.com/one_time_incentives/create/';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"merchant":"ac4f7938383a11e89ecbbc764e1107f2","customer":"00026001","description":"One-Time Item Discount","expires":"2024-05-21 00:00:00","item":"a6f7305aed3511eebfaf6a353c182723","stacking_type":"additional","external_code":"one_time_item_discount","incentive":{"type":"Discount","name":"One-Time Item Discount","discount_type":"Discount Percent","value":"75.00","field":"total_price","target":"item"}}'
};

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

```go One Time Individual Item Discount
package main

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

func main() {

	url := "https://restapi.ordergroove.com/one_time_incentives/create/"

	payload := strings.NewReader("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Item Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_item_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Item Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\"\n  }\n}")

	req, _ := http.NewRequest("POST", 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 One Time Individual Item Discount
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/one_time_incentives/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Item Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_item_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Item Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\"\n  }\n}"

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

```java One Time Individual Item Discount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/one_time_incentives/create/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Item Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_item_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Item Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\"\n  }\n}")
  .asString();
```

```php One Time Individual Item Discount
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/one_time_incentives/create/', [
  'body' => '{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Item Discount",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_item_discount",
  "incentive": {
    "type": "Discount",
    "name": "One-Time Item Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "target": "item"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp One Time Individual Item Discount
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/one_time_incentives/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"customer\": \"00026001\",\n  \"description\": \"One-Time Item Discount\",\n  \"expires\": \"2024-05-21 00:00:00\",\n  \"item\": \"a6f7305aed3511eebfaf6a353c182723\",\n  \"stacking_type\": \"additional\",\n  \"external_code\": \"one_time_item_discount\",\n  \"incentive\": {\n    \"type\": \"Discount\",\n    \"name\": \"One-Time Item Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"target\": \"item\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift One Time Individual Item Discount
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "customer": "00026001",
  "description": "One-Time Item Discount",
  "expires": "2024-05-21 00:00:00",
  "item": "a6f7305aed3511eebfaf6a353c182723",
  "stacking_type": "additional",
  "external_code": "one_time_item_discount",
  "incentive": [
    "type": "Discount",
    "name": "One-Time Item Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "target": "item"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/one_time_incentives/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```