Create draft coupon
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.diller.app/api/v2.0/stores/your-store-id/coupon"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"external_ids\": [ { \"platform\": \"example\", \"external_id\": \"example\" } ], \"code\": \"example\", \"title\": \"example\", \"description\": \"example\", \"valid_from\": \"2026-09-11T12:34:49\", \"valid_to\": \"2026-09-11T12:34:49\", \"type\": \"Standard\", \"discount_type\": \"NotDefined\", \"discount_value\": 1, \"max_redemptions\": 1, \"redemption_rules\": [ { \"channel\": \"example\", \"product_ids\": [ \"example\" ], \"category_ids\": [ \"example\" ] } ] }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.diller.app/api/v2.0/stores/your-store-id/coupon"
payload := strings.NewReader("{ \"external_ids\": [ { \"platform\": \"example\", \"external_id\": \"example\" } ], \"code\": \"example\", \"title\": \"example\", \"description\": \"example\", \"valid_from\": \"2026-09-11T12:34:49\", \"valid_to\": \"2026-09-11T12:34:49\", \"type\": \"Standard\", \"discount_type\": \"NotDefined\", \"discount_value\": 1, \"max_redemptions\": 1, \"redemption_rules\": [ { \"channel\": \"example\", \"product_ids\": [ \"example\" ], \"category_ids\": [ \"example\" ] } ] }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") 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))
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"external_ids\": [ { \"platform\": \"example\", \"external_id\": \"example\" } ], \"code\": \"example\", \"title\": \"example\", \"description\": \"example\", \"valid_from\": \"2026-09-11T12:34:49\", \"valid_to\": \"2026-09-11T12:34:49\", \"type\": \"Standard\", \"discount_type\": \"NotDefined\", \"discount_value\": 1, \"max_redemptions\": 1, \"redemption_rules\": [ { \"channel\": \"example\", \"product_ids\": [ \"example\" ], \"category_ids\": [ \"example\" ] } ] }");Request request = new Request.Builder() .url("https://api.diller.app/api/v2.0/stores/your-store-id/coupon") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.diller.app/api/v2.0/stores/your-store-id/coupon', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, data: { external_ids: [{platform: 'example', external_id: 'example'}], code: 'example', title: 'example', description: 'example', valid_from: '2026-09-11T12:34:49', valid_to: '2026-09-11T12:34:49', type: 'Standard', discount_type: 'NotDefined', discount_value: 1, max_redemptions: 1, redemption_rules: [{channel: 'example', product_ids: ['example'], category_ids: ['example']}] }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.diller.app/api/v2.0/stores/your-store-id/coupon';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"external_ids":[{"platform":"example","external_id":"example"}],"code":"example","title":"example","description":"example","valid_from":"2026-09-11T12:34:49","valid_to":"2026-09-11T12:34:49","type":"Standard","discount_type":"NotDefined","discount_value":1,"max_redemptions":1,"redemption_rules":[{"channel":"example","product_ids":["example"],"category_ids":["example"]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.diller.app/api/v2.0/stores/your-store-id/coupon \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "external_ids": [ { "platform": "example", "external_id": "example" } ], "code": "example", "title": "example", "description": "example", "valid_from": "2026-09-11T12:34:49", "valid_to": "2026-09-11T12:34:49", "type": "Standard", "discount_type": "NotDefined", "discount_value": 1, "max_redemptions": 1, "redemption_rules": [ { "channel": "example", "product_ids": [ "example" ], "category_ids": [ "example" ] } ] }'Creates a new draft coupon for the store.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
your-store-idRequest Body
Section titled “Request Body”object
object
This is the ID the cupon has in the external system / platform.
The startDate of the coupon
Example
2026-09-11T12:34:49Example
2026-09-11T12:34:49These are the types of coupons that can be created via API.
A collection of rules that define where and how the coupon can be redeemed. Each rule specifies the applicable channel, products, and categories for coupon usage.
Represents a rule for coupon redemption, defining the applicable channels, products, and categories.
object
The sales channel where the coupon can be redeemed. Valid values include ‘Pos’ (Point of Sale) for in-store purchases and ‘OnlineStore’ for online purchases.
A list of product IDs that the coupon applies to. If specified, the coupon can only be used for these products.
A list of product category IDs that the coupon applies to. If specified, the coupon can only be used for products within these categories.
object
object
This is the ID the cupon has in the external system / platform.
The startDate of the coupon
Example
2026-09-11T12:34:49Example
2026-09-11T12:34:49These are the types of coupons that can be created via API.
A collection of rules that define where and how the coupon can be redeemed. Each rule specifies the applicable channel, products, and categories for coupon usage.
Represents a rule for coupon redemption, defining the applicable channels, products, and categories.
object
The sales channel where the coupon can be redeemed. Valid values include ‘Pos’ (Point of Sale) for in-store purchases and ‘OnlineStore’ for online purchases.
A list of product IDs that the coupon applies to. If specified, the coupon can only be used for these products.
A list of product category IDs that the coupon applies to. If specified, the coupon can only be used for products within these categories.
object
object
This is the ID the cupon has in the external system / platform.
The startDate of the coupon
Example
2026-09-11T12:34:49Example
2026-09-11T12:34:49These are the types of coupons that can be created via API.
A collection of rules that define where and how the coupon can be redeemed. Each rule specifies the applicable channel, products, and categories for coupon usage.
Represents a rule for coupon redemption, defining the applicable channels, products, and categories.
object
The sales channel where the coupon can be redeemed. Valid values include ‘Pos’ (Point of Sale) for in-store purchases and ‘OnlineStore’ for online purchases.
A list of product IDs that the coupon applies to. If specified, the coupon can only be used for these products.
A list of product category IDs that the coupon applies to. If specified, the coupon can only be used for products within these categories.
Responses
Section titled “Responses”OK
object
object
This is the ID the cupon has in the external system / platform.
The startDate of the coupon
DEPRECATED: This property is being phased out and should no longer be used. Please use the property ‘RedemptionRules’.
A collection of rules that define where and how the coupon can be redeemed. Each rule specifies the applicable channel, products, and categories for coupon usage.
Represents a rule for coupon redemption, defining the applicable channels, products, and categories.
object
The sales channel where the coupon can be redeemed. Valid values include ‘Pos’ (Point of Sale) for in-store purchases and ‘OnlineStore’ for online purchases.
A list of product IDs that the coupon applies to. If specified, the coupon can only be used for these products.
A list of product category IDs that the coupon applies to. If specified, the coupon can only be used for products within these categories.
Defines where the coupon can be applied to. The filters are cumulativelly applied.
object
Example
[ { "valid_from": "2026-09-11T12:34:49", "valid_to": "2026-09-11T12:34:49", "type": "Standard", "discount_type": "NotDefined" }]Bad Request
object
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "errors": { "additionalProperty": [ "example" ] }}