> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ordergroove.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.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.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: ordergroove-restrpc
  version: 1.0.0
paths:
  /one_time_incentives/create/:
    post:
      operationId: otd-create
      summary: Create
      description: >-
        Creates a one-time discount and attaches it to a specific item, order,
        or shipping rate for an individual customer.
      tags:
        - oneTimeIncentives
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '201':
          description: '201'
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/One-Time
                  Incentives_otd-create_Response_201
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Otd-createRequestBadRequestError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                merchant:
                  type: string
                  description: Merchant ID
                customer:
                  type: string
                  description: Customer ID
                description:
                  type: string
                  description: Description
                expires:
                  type: string
                  format: date
                  description: Date by which Order Must Place to Apply discount
                item:
                  type: string
                  description: >-
                    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:
                  type: string
                  description: >-
                    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:
                  type: string
                  default: base
                  description: >-
                    Choose 'base' or 'additional' for a standard discount or an
                    additive one (defaults to 'base')
                external_code:
                  type: string
                  description: External Code
                incentive:
                  $ref: >-
                    #/components/schemas/OneTimeIncentivesCreatePostRequestBodyContentApplicationJsonSchemaIncentive
                  description: Incentive Object
              required:
                - merchant
                - customer
servers:
  - url: https://restapi.ordergroove.com
    description: https://restapi.ordergroove.com
components:
  schemas:
    OneTimeIncentivesCreatePostRequestBodyContentApplicationJsonSchemaIncentive:
      type: object
      properties:
        name:
          type: string
          description: Anything to help identify this incentive
        discount_type:
          type: string
          description: >-
            Choose 'Discount Percent' for a percent off discount or 'Discount
            Amount' for a flat dollar off discount.
        value:
          type: string
          description: The value of the discount eg 5 for $5 off or 10 for 10% off
        field:
          type: string
          description: >-
            If using `target: "item"`, field should be 'total_price'. If using
            `target: "order"`, field should be 'sub_total' or 'shipping_total'.
        type:
          type: string
          description: Must send 'Discount'
        target:
          type: string
          description: >-
            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'.
        limit_policy:
          type: string
          description: >-
            Specifies the type of limit policy. Currently only `fixed` is
            supported. This policy indicates that the `limit_value` should be
            interpreted as a hard-coded dollar amount limit per incentive
            target. `limit_policy` and `limit_value` must be supplied together,
            or both left out.
        limit_value:
          type: number
          format: double
          description: >-
            Used to configure the discount limit. The exact behaviour depends on
            the defined `limit_policy`. `limit_policy` and `limit_value` must be
            supplied together, or both left out.
      required:
        - name
        - discount_type
        - value
        - field
        - type
        - target
      description: Incentive Object
      title: >-
        OneTimeIncentivesCreatePostRequestBodyContentApplicationJsonSchemaIncentive
    OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf0Incentive:
      type: object
      properties:
        type:
          type: string
        public_id:
          type: string
        discount_type:
          type: string
        target:
          type: string
        field:
          type: string
        name:
          type: string
        value:
          type: string
        threshold_field:
          description: Any type
        threshold_value:
          description: Any type
      title: >-
        OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf0Incentive
    OneTimeIncentivesOtdCreateResponse2010:
      type: object
      properties:
        public_id:
          type: string
        external_code:
          type: string
        description:
          type: string
        merchant:
          type: string
        customer:
          type: string
        item:
          type: string
        created:
          type: string
        last_updated:
          type: string
        order:
          description: Any type
        incentive:
          $ref: >-
            #/components/schemas/OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf0Incentive
      title: OneTimeIncentivesOtdCreateResponse2010
    OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf1Incentive:
      type: object
      properties:
        name:
          type: string
        public_id:
          type: string
        type:
          type: string
        field:
          type: string
        discount_type:
          type: string
        value:
          type: string
        threshold_field:
          description: Any type
        threshold_value:
          description: Any type
        target:
          type: string
      title: >-
        OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf1Incentive
    OneTimeIncentivesOtdCreateResponse2011:
      type: object
      properties:
        public_id:
          type: string
        external_code:
          type: string
        description:
          type: string
        customer:
          type: string
        merchant:
          type: string
        order:
          type: string
        incentive:
          $ref: >-
            #/components/schemas/OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf1Incentive
        created:
          type: string
        last_updated:
          type: string
        expires:
          type: string
        stacking_type:
          type: string
        item:
          description: Any type
      title: OneTimeIncentivesOtdCreateResponse2011
    OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf2Incentive:
      type: object
      properties:
        name:
          type: string
        public_id:
          type: string
        type:
          type: string
        field:
          type: string
        discount_type:
          type: string
        value:
          type: string
        threshold_field:
          description: Any type
        threshold_value:
          description: Any type
        target:
          type: string
      title: >-
        OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf2Incentive
    OneTimeIncentivesOtdCreateResponse2012:
      type: object
      properties:
        public_id:
          type: string
        external_code:
          type: string
        description:
          type: string
        customer:
          type: string
        merchant:
          type: string
        order:
          type: string
        incentive:
          $ref: >-
            #/components/schemas/OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf2Incentive
        created:
          type: string
        last_updated:
          type: string
        expires:
          type: string
        stacking_type:
          type: string
        item:
          description: Any type
      title: OneTimeIncentivesOtdCreateResponse2012
    OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf3Incentive:
      type: object
      properties:
        name:
          type: string
        public_id:
          type: string
        type:
          type: string
        field:
          type: string
        discount_type:
          type: string
        value:
          type: string
        threshold_field:
          type: string
        threshold_value:
          type: string
        target:
          type: string
      title: >-
        OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf3Incentive
    OneTimeIncentivesOtdCreateResponse2013:
      type: object
      properties:
        public_id:
          type: string
        external_code:
          type: string
        description:
          type: string
        customer:
          type: string
        merchant:
          type: string
        order:
          type: string
        incentive:
          $ref: >-
            #/components/schemas/OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf3Incentive
        created:
          type: string
        last_updated:
          type: string
        expires:
          type: string
        stacking_type:
          type: string
        item:
          description: Any type
      title: OneTimeIncentivesOtdCreateResponse2013
    OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf4Incentive:
      type: object
      properties:
        name:
          type: string
        public_id:
          type: string
        type:
          type: string
        field:
          type: string
        discount_type:
          type: string
        value:
          type: string
        threshold_field:
          description: Any type
        threshold_value:
          description: Any type
        target:
          type: string
      title: >-
        OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf4Incentive
    OneTimeIncentivesOtdCreateResponse2014:
      type: object
      properties:
        public_id:
          type: string
        external_code:
          type: string
        description:
          type: string
        customer:
          type: string
        merchant:
          type: string
        order:
          type: string
        incentive:
          $ref: >-
            #/components/schemas/OneTimeIncentivesCreatePostResponsesContentApplicationJsonSchemaOneOf4Incentive
        created:
          type: string
        last_updated:
          type: string
        expires:
          type: string
        stacking_type:
          type: string
        item:
          description: Any type
      title: OneTimeIncentivesOtdCreateResponse2014
    One-Time Incentives_otd-create_Response_201:
      oneOf:
        - $ref: '#/components/schemas/OneTimeIncentivesOtdCreateResponse2010'
        - $ref: '#/components/schemas/OneTimeIncentivesOtdCreateResponse2011'
        - $ref: '#/components/schemas/OneTimeIncentivesOtdCreateResponse2012'
        - $ref: '#/components/schemas/OneTimeIncentivesOtdCreateResponse2013'
        - $ref: '#/components/schemas/OneTimeIncentivesOtdCreateResponse2014'
      title: One-Time Incentives_otd-create_Response_201
    Otd-createRequestBadRequestError:
      type: object
      properties:
        '[field_name]':
          type: string
      title: Otd-createRequestBadRequestError
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

```

## Examples

### One Time Item Discount



**Request**

```json
undefined
```

**Response**

```json
{}
```

**SDK Code**

```python One Time Item Discount
import requests

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

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

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>', 'Content-Type': 'application/json'},
  body: undefined
};

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>")
	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
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'

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>")
  .header("Content-Type", "application/json")
  .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' => [
    'Content-Type' => 'application/json',
    '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>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift One Time Item Discount
import Foundation

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

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": {
    "name": "One-Time Order Total Discount",
    "discount_type": "Discount Amount",
    "value": "25.00",
    "field": "sub_total",
    "type": "Discount",
    "target": "order"
  }
}
```

**Response**

```json
{}
```

**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": {
        "name": "One-Time Order Total Discount",
        "discount_type": "Discount Amount",
        "value": "25.00",
        "field": "sub_total",
        "type": "Discount",
        "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":{"name":"One-Time Order Total Discount","discount_type":"Discount Amount","value":"25.00","field":"sub_total","type":"Discount","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    \"name\": \"One-Time Order Total Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"25.00\",\n    \"field\": \"sub_total\",\n    \"type\": \"Discount\",\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    \"name\": \"One-Time Order Total Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"25.00\",\n    \"field\": \"sub_total\",\n    \"type\": \"Discount\",\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    \"name\": \"One-Time Order Total Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"25.00\",\n    \"field\": \"sub_total\",\n    \"type\": \"Discount\",\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": {
    "name": "One-Time Order Total Discount",
    "discount_type": "Discount Amount",
    "value": "25.00",
    "field": "sub_total",
    "type": "Discount",
    "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    \"name\": \"One-Time Order Total Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"25.00\",\n    \"field\": \"sub_total\",\n    \"type\": \"Discount\",\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": [
    "name": "One-Time Order Total Discount",
    "discount_type": "Discount Amount",
    "value": "25.00",
    "field": "sub_total",
    "type": "Discount",
    "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": {
    "name": "One Time Order Shipping Discount",
    "discount_type": "Discount Amount",
    "value": "4.50",
    "field": "shipping_total",
    "type": "Discount",
    "target": "order"
  }
}
```

**Response**

```json
{}
```

**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": {
        "name": "One Time Order Shipping Discount",
        "discount_type": "Discount Amount",
        "value": "4.50",
        "field": "shipping_total",
        "type": "Discount",
        "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":{"name":"One Time Order Shipping Discount","discount_type":"Discount Amount","value":"4.50","field":"shipping_total","type":"Discount","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    \"name\": \"One Time Order Shipping Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"4.50\",\n    \"field\": \"shipping_total\",\n    \"type\": \"Discount\",\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    \"name\": \"One Time Order Shipping Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"4.50\",\n    \"field\": \"shipping_total\",\n    \"type\": \"Discount\",\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    \"name\": \"One Time Order Shipping Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"4.50\",\n    \"field\": \"shipping_total\",\n    \"type\": \"Discount\",\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": {
    "name": "One Time Order Shipping Discount",
    "discount_type": "Discount Amount",
    "value": "4.50",
    "field": "shipping_total",
    "type": "Discount",
    "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    \"name\": \"One Time Order Shipping Discount\",\n    \"discount_type\": \"Discount Amount\",\n    \"value\": \"4.50\",\n    \"field\": \"shipping_total\",\n    \"type\": \"Discount\",\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": [
    "name": "One Time Order Shipping Discount",
    "discount_type": "Discount Amount",
    "value": "4.50",
    "field": "shipping_total",
    "type": "Discount",
    "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": {
    "name": "One-Time Order Discount With Threshold",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "sub_total",
    "type": "Discount",
    "target": "order",
    "threshold_field": "sub_total",
    "threshold_value": "20.00"
  }
}
```

**Response**

```json
{}
```

**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": {
        "name": "One-Time Order Discount With Threshold",
        "discount_type": "Discount Percent",
        "value": "75.00",
        "field": "sub_total",
        "type": "Discount",
        "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":{"name":"One-Time Order Discount With Threshold","discount_type":"Discount Percent","value":"75.00","field":"sub_total","type":"Discount","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    \"name\": \"One-Time Order Discount With Threshold\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"sub_total\",\n    \"type\": \"Discount\",\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    \"name\": \"One-Time Order Discount With Threshold\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"sub_total\",\n    \"type\": \"Discount\",\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    \"name\": \"One-Time Order Discount With Threshold\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"sub_total\",\n    \"type\": \"Discount\",\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": {
    "name": "One-Time Order Discount With Threshold",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "sub_total",
    "type": "Discount",
    "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    \"name\": \"One-Time Order Discount With Threshold\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"sub_total\",\n    \"type\": \"Discount\",\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": [
    "name": "One-Time Order Discount With Threshold",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "sub_total",
    "type": "Discount",
    "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": {
    "name": "One-Time All Order Items Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "type": "Discount",
    "target": "item"
  }
}
```

**Response**

```json
{}
```

**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": {
        "name": "One-Time All Order Items Discount",
        "discount_type": "Discount Percent",
        "value": "75.00",
        "field": "total_price",
        "type": "Discount",
        "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":{"name":"One-Time All Order Items Discount","discount_type":"Discount Percent","value":"75.00","field":"total_price","type":"Discount","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    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"type\": \"Discount\",\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    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"type\": \"Discount\",\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    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"type\": \"Discount\",\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": {
    "name": "One-Time All Order Items Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "type": "Discount",
    "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    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"type\": \"Discount\",\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": [
    "name": "One-Time All Order Items Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "type": "Discount",
    "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 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": {
    "name": "One-Time All Order Items Discount",
    "discount_type": "string",
    "value": "string",
    "field": "string",
    "type": "Gift",
    "target": "item",
    "product": "43929919127725"
  }
}
```

**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": {
        "name": "One-Time All Order Items Discount",
        "discount_type": "string",
        "value": "string",
        "field": "string",
        "type": "Gift",
        "target": "item",
        "product": "43929919127725"
    }
}
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":{"name":"One-Time All Order Items Discount","discount_type":"string","value":"string","field":"string","type":"Gift","target":"item","product":"43929919127725"}}'
};

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    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"string\",\n    \"value\": \"string\",\n    \"field\": \"string\",\n    \"type\": \"Gift\",\n    \"target\": \"item\",\n    \"product\": \"43929919127725\"\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    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"string\",\n    \"value\": \"string\",\n    \"field\": \"string\",\n    \"type\": \"Gift\",\n    \"target\": \"item\",\n    \"product\": \"43929919127725\"\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    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"string\",\n    \"value\": \"string\",\n    \"field\": \"string\",\n    \"type\": \"Gift\",\n    \"target\": \"item\",\n    \"product\": \"43929919127725\"\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": {
    "name": "One-Time All Order Items Discount",
    "discount_type": "string",
    "value": "string",
    "field": "string",
    "type": "Gift",
    "target": "item",
    "product": "43929919127725"
  }
}',
  '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    \"name\": \"One-Time All Order Items Discount\",\n    \"discount_type\": \"string\",\n    \"value\": \"string\",\n    \"field\": \"string\",\n    \"type\": \"Gift\",\n    \"target\": \"item\",\n    \"product\": \"43929919127725\"\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": [
    "name": "One-Time All Order Items Discount",
    "discount_type": "string",
    "value": "string",
    "field": "string",
    "type": "Gift",
    "target": "item",
    "product": "43929919127725"
  ]
] 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": {
    "name": "One-Time Item Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "type": "Discount",
    "target": "item"
  }
}
```

**Response**

```json
{}
```

**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": {
        "name": "One-Time Item Discount",
        "discount_type": "Discount Percent",
        "value": "75.00",
        "field": "total_price",
        "type": "Discount",
        "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":{"name":"One-Time Item Discount","discount_type":"Discount Percent","value":"75.00","field":"total_price","type":"Discount","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    \"name\": \"One-Time Item Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"type\": \"Discount\",\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    \"name\": \"One-Time Item Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"type\": \"Discount\",\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    \"name\": \"One-Time Item Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"type\": \"Discount\",\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": {
    "name": "One-Time Item Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "type": "Discount",
    "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    \"name\": \"One-Time Item Discount\",\n    \"discount_type\": \"Discount Percent\",\n    \"value\": \"75.00\",\n    \"field\": \"total_price\",\n    \"type\": \"Discount\",\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": [
    "name": "One-Time Item Discount",
    "discount_type": "Discount Percent",
    "value": "75.00",
    "field": "total_price",
    "type": "Discount",
    "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()
```