NodeRingsDocs

Generate Coupon Codes

Generate Coupon Codes on the NodeRings provider API (POST /v1/coupons/{couponId}/codes:generate).

POST
/v1/coupons/{couponId}/codes:generate
Authorization<token>

Bearer token

In: header

X-Organization-ID<token>

Tenant or organization identifier

In: header

Path Parameters

couponIdstring
count?integer
Formatint32
prefix?string

Optional letters or digits put before each code as PREFIX-XXXXXXXXXX.

maxRedemptions?integer

Uses per code. Defaults to 1 (single-use).

Formatint32
validUntil?string
Formatdate-time
campaign?string
channel?string

Response Body

application/json

curl -X POST "https://api.noderings.com/v1/coupons/{couponId}/codes:generate" \  -H "Authorization: Bearer {your_token}" \  -H "X-Organization-ID: {your_org_id}" \  -H "Content-Type: application/json" \  -d '{  "count": 0,  "prefix": "string",  "maxRedemptions": 0,  "validUntil": "string",  "campaign": "string",  "channel": "string"}'
{
  "batchId": "string",
  "count": 0,
  "batch": {
    "id": "string",
    "couponId": "string",
    "status": "COUPON_CODE_BATCH_STATUS_UNSPECIFIED",
    "requestedCount": 0,
    "generatedCount": 0,
    "prefix": "string",
    "maxRedemptions": 0,
    "validUntil": "2019-08-24T14:15:22Z",
    "campaign": "string",
    "channel": "string",
    "failureReason": "string",
    "completedAt": "2019-08-24T14:15:22Z",
    "exportCount": 0,
    "lastExportedAt": "2019-08-24T14:15:22Z",
    "lastExportedByUserId": "string",
    "timestamps": {
      "createTime": "2019-08-24T14:15:22Z",
      "updateTime": "2019-08-24T14:15:22Z"
    }
  }
}