Ulsav Docs

Coupons

List coupons

GET
/api/v1/organizations/{organization_id}/coupons

Path Parameters

organization_id*string

Query Parameters

eventGroupIds?array<string>|

Filter to coupons targeting the named EventGroups or their Events and Passes. Repeat or comma-separate for several.

limit?integer

Page size (1-100)

Formatint64
Range1 <= value <= 100
Default20
cursor?string

Opaque cursor from meta.nextCursor

includeTotal?boolean

Set false to omit meta.total

Defaulttrue

Response Body

OK

application/json
  1. response
$schema?string

A URL to the JSON Schema for this object.

Formaturi
data*array<>|null
meta*
Example Request
curl -X GET 'https://example.com/api/v1/organizations/string/coupons'
Example Response
{  "$schema": "https://example.com/schemas/PageCouponView.json",  "data": [    {      "$schema": "https://example.com/schemas/CouponView.json",      "codes": [        {          "$schema": "https://example.com/schemas/CodeView.json",          "allowedAccountId": "string",          "campaign": "string",          "code": "string",          "id": "string",          "isActive": true,          "isPublic": true,          "maxDiscountBudgetMinorUnits": 0,          "maxRedemptions": 0,          "maxUsesPerUser": 0,          "usageMode": "string",          "validFrom": "2019-08-24T14:15:22Z",          "validTo": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "currentVersion": 0,      "description": "string",      "id": "string",      "name": "string",      "organizationId": "string",      "rule": {        "application": "string",        "effectType": "string",        "effectValue": 0,        "firstPurchaseOnly": true,        "maxDiscountMinorUnits": 0,        "minQuantity": 0,        "minSubtotalMinorUnits": 0,        "overrides": [          {            "effectType": "string",            "effectValue": 0,            "maxDiscountMinorUnits": 0,            "passId": "string"          }        ],        "version": 0      },      "status": "string",      "targets": [        {          "scopeType": "string",          "targetId": "string"        }      ],      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "meta": {    "hasMore": true,    "limit": 0,    "nextCursor": "string",    "total": 0  }}

Create a coupon

POST
/api/v1/organizations/{organization_id}/coupons

Path Parameters

organization_id*string

Request Body

application/json
  1. body
application*string
codes*array<>|null
description*string
effectType*string
effectValue*integer
Formatint64
firstPurchaseOnly*boolean
maxDiscountMinorUnits?integer
Formatint64
minQuantity?integer
Formatint64
minSubtotalMinorUnits?integer
Formatint64
name*string
overrides?array<>|null
targets?array<>|null

Response Body

OK

application/json
  1. response
$schema?string

A URL to the JSON Schema for this object.

Formaturi
codes*array<>|null
createdAt*string
Formatdate-time
currentVersion?integer
Formatint32
description*string
id*string
name*string
organizationId*string
rule*
status*string
targets*array<>|null
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/v1/organizations/string/coupons' \  -H 'Content-Type: application/json' \  -d '{  "application": "string",  "codes": [    {      "code": "string",      "isPublic": true    }  ],  "description": "string",  "effectType": "string",  "effectValue": 0,  "firstPurchaseOnly": true,  "name": "string"}'
Example Response
{  "$schema": "https://example.com/schemas/CouponView.json",  "codes": [    {      "$schema": "https://example.com/schemas/CodeView.json",      "allowedAccountId": "string",      "campaign": "string",      "code": "string",      "id": "string",      "isActive": true,      "isPublic": true,      "maxDiscountBudgetMinorUnits": 0,      "maxRedemptions": 0,      "maxUsesPerUser": 0,      "usageMode": "string",      "validFrom": "2019-08-24T14:15:22Z",      "validTo": "2019-08-24T14:15:22Z"    }  ],  "createdAt": "2019-08-24T14:15:22Z",  "currentVersion": 0,  "description": "string",  "id": "string",  "name": "string",  "organizationId": "string",  "rule": {    "application": "string",    "effectType": "string",    "effectValue": 0,    "firstPurchaseOnly": true,    "maxDiscountMinorUnits": 0,    "minQuantity": 0,    "minSubtotalMinorUnits": 0,    "overrides": [      {        "effectType": "string",        "effectValue": 0,        "maxDiscountMinorUnits": 0,        "passId": "string"      }    ],    "version": 0  },  "status": "string",  "targets": [    {      "scopeType": "string",      "targetId": "string"    }  ],  "updatedAt": "2019-08-24T14:15:22Z"}
PUT
/api/v1/organizations/{organization_id}/coupons/codes/{code_id}

Path Parameters

organization_id*string
code_id*string

Request Body

application/json
  1. body
isActive*boolean

Response Body

OK

application/json
  1. response
$schema?string

A URL to the JSON Schema for this object.

Formaturi
allowedAccountId?string
campaign?string
code*string
id*string
isActive*boolean
isPublic*boolean
maxDiscountBudgetMinorUnits?integer
Formatint64
maxRedemptions?integer
Formatint32
maxUsesPerUser?integer
Formatint32
usageMode*string
validFrom?string
Formatdate-time
validTo?string
Formatdate-time
Example Request
curl -X PUT 'https://example.com/api/v1/organizations/string/coupons/codes/string' \  -H 'Content-Type: application/json' \  -d '{  "isActive": true}'
Example Response
{  "$schema": "https://example.com/schemas/CodeView.json",  "allowedAccountId": "string",  "campaign": "string",  "code": "string",  "id": "string",  "isActive": true,  "isPublic": true,  "maxDiscountBudgetMinorUnits": 0,  "maxRedemptions": 0,  "maxUsesPerUser": 0,  "usageMode": "string",  "validFrom": "2019-08-24T14:15:22Z",  "validTo": "2019-08-24T14:15:22Z"}
GET
/api/v1/organizations/{organization_id}/coupons/public

Path Parameters

organization_id*string

Query Parameters

limit?integer

Page size (1-100)

Formatint64
Range1 <= value <= 100
Default20
cursor?string

Opaque cursor from meta.nextCursor

includeTotal?boolean

Set false to omit meta.total

Defaulttrue

Response Body

OK

application/json
  1. response
$schema?string

A URL to the JSON Schema for this object.

Formaturi
data*array<>|null
meta*
Example Request
curl -X GET 'https://example.com/api/v1/organizations/string/coupons/public'
Example Response
{  "$schema": "https://example.com/schemas/PagePublicView.json",  "data": [    {      "campaign": "string",      "code": "string",      "description": "string",      "effectType": "string",      "effectValue": 0,      "id": "string",      "maxDiscountMinorUnits": 0,      "minSubtotalMinorUnits": 0,      "name": "string",      "validTo": "2019-08-24T14:15:22Z"    }  ],  "meta": {    "hasMore": true,    "limit": 0,    "nextCursor": "string",    "total": 0  }}

Read a coupon

GET
/api/v1/organizations/{organization_id}/coupons/{coupon_id}

Path Parameters

organization_id*string
coupon_id*string

Response Body

OK

application/json
  1. response
$schema?string

A URL to the JSON Schema for this object.

Formaturi
codes*array<>|null
createdAt*string
Formatdate-time
currentVersion?integer
Formatint32
description*string
id*string
name*string
organizationId*string
rule*
status*string
targets*array<>|null
updatedAt*string
Formatdate-time
Example Request
curl -X GET 'https://example.com/api/v1/organizations/string/coupons/string'
Example Response
{  "$schema": "https://example.com/schemas/CouponView.json",  "codes": [    {      "$schema": "https://example.com/schemas/CodeView.json",      "allowedAccountId": "string",      "campaign": "string",      "code": "string",      "id": "string",      "isActive": true,      "isPublic": true,      "maxDiscountBudgetMinorUnits": 0,      "maxRedemptions": 0,      "maxUsesPerUser": 0,      "usageMode": "string",      "validFrom": "2019-08-24T14:15:22Z",      "validTo": "2019-08-24T14:15:22Z"    }  ],  "createdAt": "2019-08-24T14:15:22Z",  "currentVersion": 0,  "description": "string",  "id": "string",  "name": "string",  "organizationId": "string",  "rule": {    "application": "string",    "effectType": "string",    "effectValue": 0,    "firstPurchaseOnly": true,    "maxDiscountMinorUnits": 0,    "minQuantity": 0,    "minSubtotalMinorUnits": 0,    "overrides": [      {        "effectType": "string",        "effectValue": 0,        "maxDiscountMinorUnits": 0,        "passId": "string"      }    ],    "version": 0  },  "status": "string",  "targets": [    {      "scopeType": "string",      "targetId": "string"    }  ],  "updatedAt": "2019-08-24T14:15:22Z"}
PUT
/api/v1/organizations/{organization_id}/coupons/{coupon_id}

Path Parameters

organization_id*string
coupon_id*string

Request Body

application/json
  1. body
application*string
codes*array<>|null
description*string
effectType*string
effectValue*integer
Formatint64
firstPurchaseOnly*boolean
maxDiscountMinorUnits?integer
Formatint64
minQuantity?integer
Formatint64
minSubtotalMinorUnits?integer
Formatint64
name*string
overrides?array<>|null
targets?array<>|null

Response Body

OK

application/json
  1. response
$schema?string

A URL to the JSON Schema for this object.

Formaturi
codes*array<>|null
createdAt*string
Formatdate-time
currentVersion?integer
Formatint32
description*string
id*string
name*string
organizationId*string
rule*
status*string
targets*array<>|null
updatedAt*string
Formatdate-time
Example Request
curl -X PUT 'https://example.com/api/v1/organizations/string/coupons/string' \  -H 'Content-Type: application/json' \  -d '{  "application": "string",  "codes": [    {      "code": "string",      "isPublic": true    }  ],  "description": "string",  "effectType": "string",  "effectValue": 0,  "firstPurchaseOnly": true,  "name": "string"}'
Example Response
{  "$schema": "https://example.com/schemas/CouponView.json",  "codes": [    {      "$schema": "https://example.com/schemas/CodeView.json",      "allowedAccountId": "string",      "campaign": "string",      "code": "string",      "id": "string",      "isActive": true,      "isPublic": true,      "maxDiscountBudgetMinorUnits": 0,      "maxRedemptions": 0,      "maxUsesPerUser": 0,      "usageMode": "string",      "validFrom": "2019-08-24T14:15:22Z",      "validTo": "2019-08-24T14:15:22Z"    }  ],  "createdAt": "2019-08-24T14:15:22Z",  "currentVersion": 0,  "description": "string",  "id": "string",  "name": "string",  "organizationId": "string",  "rule": {    "application": "string",    "effectType": "string",    "effectValue": 0,    "firstPurchaseOnly": true,    "maxDiscountMinorUnits": 0,    "minQuantity": 0,    "minSubtotalMinorUnits": 0,    "overrides": [      {        "effectType": "string",        "effectValue": 0,        "maxDiscountMinorUnits": 0,        "passId": "string"      }    ],    "version": 0  },  "status": "string",  "targets": [    {      "scopeType": "string",      "targetId": "string"    }  ],  "updatedAt": "2019-08-24T14:15:22Z"}

Add a coupon code

POST
/api/v1/organizations/{organization_id}/coupons/{coupon_id}/codes

Path Parameters

organization_id*string
coupon_id*string

Request Body

application/json
  1. body
allowedAccountId?string
campaign?string
code*string
isPublic*boolean
maxDiscountBudgetMinorUnits?integer
Formatint64
maxRedemptions?integer
Formatint64
maxUsesPerUser?integer
Formatint64
usageMode?string
validFrom?string
Formatdate-time
validTo?string
Formatdate-time

Response Body

OK

application/json
  1. response
$schema?string

A URL to the JSON Schema for this object.

Formaturi
allowedAccountId?string
campaign?string
code*string
id*string
isActive*boolean
isPublic*boolean
maxDiscountBudgetMinorUnits?integer
Formatint64
maxRedemptions?integer
Formatint32
maxUsesPerUser?integer
Formatint32
usageMode*string
validFrom?string
Formatdate-time
validTo?string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/v1/organizations/string/coupons/string/codes' \  -H 'Content-Type: application/json' \  -d '{  "code": "string",  "isPublic": true}'
Example Response
{  "$schema": "https://example.com/schemas/CodeView.json",  "allowedAccountId": "string",  "campaign": "string",  "code": "string",  "id": "string",  "isActive": true,  "isPublic": true,  "maxDiscountBudgetMinorUnits": 0,  "maxRedemptions": 0,  "maxUsesPerUser": 0,  "usageMode": "string",  "validFrom": "2019-08-24T14:15:22Z",  "validTo": "2019-08-24T14:15:22Z"}