API reference / Operations by tag
coupons
Coupon codes, batches, import and assignment to partners.
12 operations. Base URL https://api.metrixed.com/v1; see authentication, errors and pagination.
Operations
| Method | Path | Summary |
|---|---|---|
| GET | /coupons | List CouponCodes |
| POST | /coupons | Create CouponCode |
| GET | /coupons/{id} | Get CouponCode |
| PATCH | /coupons/{id} | Update CouponCode |
| DELETE | /coupons/{id} | Delete CouponCode |
| POST | /coupons/{id}/assign | Assign / unassign partners (mode add|remove|replace) |
| POST | /coupons/bulk/apply | Bulk edit apply |
| POST | /coupons/bulk/delete | Delete up to 500 coupons in one transaction (dry_run: true previews without saving) |
| POST | /coupons/bulk/preview | Bulk edit preview |
| POST | /coupons/import | Bulk import coupons from CSV (multipart file or text/csv); dry_run=1 validates only |
| POST | /coupons/search | Search CouponCodes (advanced) |
| GET | /coupons/usage | Coupon usage counters (reporting conversions, falling back to usage_count) |
GET /coupons
List CouponCodes
Operation getCoupons. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | |
page_size | query | integer | no | |
sort | query | string | no | field or -field |
include | query | string | no | comma-separated relationships |
filter | query | object (free-form) | no | |
q | query | string | no | free-text search |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json CouponCodeList |
| default | error | application/json Error |
curl 'https://api.metrixed.com/v1/coupons?page=1&page_size=50' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"data": [
{}
],
"page": {}
}
POST /coupons
Create CouponCode
Operation postCoupons. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): CouponCodeCreate
| Field | Type | Flags | Description |
|---|---|---|---|
code | string | required | |
offer_id | string | required | |
partner_ids | array of string | ||
excluded_partner_ids | array of string | ||
type | enum: generic, exclusive, one_time | ||
description | string | ||
start_at | string (date-time) | ||
end_at | string (date-time) | ||
status | string | ||
payout_rules | array of object (free-form) | ||
attribution_mode | enum: coupon_overrides_click, click_overrides_coupon, both | ||
max_uses | integer | ||
used_at | string (date-time) |
| Status | Description | Body |
|---|---|---|
| 201 | ok | application/json CouponCode |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/coupons' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"code":"","offer_id":""}'
Example 201 response:
{
"external_ref": ""
}
GET /coupons/{id}
Get CouponCode
Operation getCouponsId. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json CouponCode |
| default | error | application/json Error |
curl 'https://api.metrixed.com/v1/coupons/<id>' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"external_ref": ""
}
PATCH /coupons/{id}
Update CouponCode
Operation patchCouponsId. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body (application/json, required): CouponCodeUpdate
| Field | Type | Flags | Description |
|---|---|---|---|
code | string | ||
offer_id | string | ||
partner_ids | array of string | ||
excluded_partner_ids | array of string | ||
type | enum: generic, exclusive, one_time | ||
description | string | ||
start_at | string (date-time) | ||
end_at | string (date-time) | ||
status | string | ||
payout_rules | array of object (free-form) | ||
attribution_mode | enum: coupon_overrides_click, click_overrides_coupon, both | ||
max_uses | integer | ||
used_at | string (date-time) |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json CouponCode |
| default | error | application/json Error |
curl -X PATCH 'https://api.metrixed.com/v1/coupons/<id>' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"code":"","offer_id":"","partner_ids":[""],"excluded_partner_ids":[""]}'
Example 200 response:
{
"external_ref": ""
}
DELETE /coupons/{id}
Delete CouponCode
Operation deleteCouponsId. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
curl -X DELETE 'https://api.metrixed.com/v1/coupons/<id>' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 204 response:
{
"ok": false
}
POST /coupons/{id}/assign
Assign / unassign partners (mode add|remove|replace)
Operation postCouponsIdAssign. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body (application/json, required): Ok
| Field | Type | Flags | Description |
|---|---|---|---|
ok | boolean |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json CouponCode |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/coupons/<id>/assign' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"ok":false}'
Example 200 response:
{
"external_ref": ""
}
POST /coupons/bulk/apply
Bulk edit apply
Operation postCouponsBulkApply. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): BulkPatch
| Field | Type | Flags | Description |
|---|---|---|---|
ids | array of string | required | |
patches | array of object | required |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json BulkPreview |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/coupons/bulk/apply' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"ids":[""],"patches":[{"field":"","value":{}}]}'
Example 200 response:
{
"affected": 0,
"changes": [
{}
],
"warnings": [
""
],
"token": ""
}
POST /coupons/bulk/delete
Delete up to 500 coupons in one transaction (dry_run: true previews without saving)
Operation postCouponsBulkDelete. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): BulkDeleteRequest
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json BulkActionResult |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/coupons/bulk/delete' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{}'
Example 200 response:
{}
POST /coupons/bulk/preview
Bulk edit preview
Operation postCouponsBulkPreview. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): BulkPatch
| Field | Type | Flags | Description |
|---|---|---|---|
ids | array of string | required | |
patches | array of object | required |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json BulkPreview |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/coupons/bulk/preview' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"ids":[""],"patches":[{"field":"","value":{}}]}'
Example 200 response:
{
"affected": 0,
"changes": [
{}
],
"warnings": [
""
],
"token": ""
}
POST /coupons/import
Bulk import coupons from CSV (multipart file or text/csv); dry_run=1 validates only
Operation postCouponsImport. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
offer_id | query | string | no | |
dry_run | query | boolean | no |
Request body (application/json, required): any
curl -X POST 'https://api.metrixed.com/v1/coupons/import' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 201 response:
{
"ok": false
}
POST /coupons/search
Search CouponCodes (advanced)
Operation postCouponsSearch. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): SearchRequest
| Field | Type | Flags | Description |
|---|---|---|---|
filters | array of object | ||
search | string | ||
sort | array of object (free-form) | ||
page | integer | ||
page_size | integer | ||
include | array of string |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json CouponCodeList |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/coupons/search' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"filters":[{}],"search":"","sort":[{}],"page":0}'
Example 200 response:
{
"data": [
{}
],
"page": {}
}
GET /coupons/usage
Coupon usage counters (reporting conversions, falling back to usage_count) Coupon usage counters (reporting conversions, falling back to usage_count). WP-67: paged; q matches the code.
Operation getCouponsUsage. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
offer_id | query | string | no | |
q | query | string | no | |
page | query | string | no | |
page_size | query | string | no | |
sort | query | string | no |
curl 'https://api.metrixed.com/v1/coupons/usage?page=1&page_size=50' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"ok": false
}