NodeRingsDocs

Create Coupon

Create Coupon on the NodeRings provider API (POST /v1/coupons).

POST
/v1/coupons
Authorization<token>

Bearer token

In: header

X-Organization-ID<token>

Tenant or organization identifier

In: header

name?string
description?string
discountType?string
  • COUPON_DISCOUNT_TYPE_CREDIT: A code that grants promotional credit instead of discounting a subscription.
Default"COUPON_DISCOUNT_TYPE_UNSPECIFIED"
Value in"COUPON_DISCOUNT_TYPE_UNSPECIFIED" | "COUPON_DISCOUNT_TYPE_PERCENTAGE" | "COUPON_DISCOUNT_TYPE_FIXED" | "COUPON_DISCOUNT_TYPE_CREDIT"
percentOff?string
amountsOff?
maxDiscountAmounts?
appliesTo?array<string>
usageMetricCodes?array<string>
assetCategories?array<string>
assetTypes?array<string>
planIds?array<string>
duration?string
  • COUPON_DURATION_ONCE: Discounts the next invoice only.
  • COUPON_DURATION_REPEATING: Discounts duration_in_periods invoices, or every invoice for duration_days.
Default"COUPON_DURATION_UNSPECIFIED"
Value in"COUPON_DURATION_UNSPECIFIED" | "COUPON_DURATION_ONCE" | "COUPON_DURATION_REPEATING" | "COUPON_DURATION_FOREVER"
durationInPeriods?integer
Formatint32
durationDays?integer
Formatint32
validFrom?string
Formatdate-time
validUntil?string

Defaults to the configured validity window unless no_expiry is set.

Formatdate-time
noExpiry?boolean
maxRedemptions?integer
Formatint32
oncePerCustomer?boolean

Defaults to true.

firstTimeCustomerOnly?boolean
acknowledgeHighRisk?boolean

Required when the terms are effectively free or unlimited.

code?string

Optional first shared code created with the coupon.

creditValidDays?integer

Lot lifetime after a credit code is redeemed. Defaults to 90.

Formatint32

Response Body

application/json

curl -X POST "https://api.noderings.com/v1/coupons" \  -H "Authorization: Bearer {your_token}" \  -H "X-Organization-ID: {your_org_id}" \  -H "Content-Type: application/json" \  -d '{  "name": "string",  "description": "string",  "discountType": "COUPON_DISCOUNT_TYPE_UNSPECIFIED",  "percentOff": "string",  "amountsOff": null,  "maxDiscountAmounts": null,  "appliesTo": [    "string"  ],  "usageMetricCodes": [    "string"  ],  "assetCategories": [    "string"  ],  "assetTypes": [    "string"  ],  "planIds": [    "string"  ],  "duration": "COUPON_DURATION_UNSPECIFIED",  "durationInPeriods": 0,  "durationDays": 0,  "validFrom": "string",  "validUntil": "string",  "noExpiry": false,  "maxRedemptions": 0,  "oncePerCustomer": false,  "firstTimeCustomerOnly": false,  "acknowledgeHighRisk": false,  "code": "string",  "creditValidDays": 0}'
{
  "coupon": {
    "id": "string",
    "name": "string",
    "description": "string",
    "discountType": "COUPON_DISCOUNT_TYPE_UNSPECIFIED",
    "percentOff": "string",
    "amountsOff": {
      "property1": "string",
      "property2": "string"
    },
    "maxDiscountAmounts": {
      "property1": "string",
      "property2": "string"
    },
    "appliesTo": [
      "string"
    ],
    "usageMetricCodes": [
      "string"
    ],
    "assetCategories": [
      "string"
    ],
    "assetTypes": [
      "string"
    ],
    "planIds": [
      "string"
    ],
    "duration": "COUPON_DURATION_UNSPECIFIED",
    "durationInPeriods": 0,
    "durationDays": 0,
    "validFrom": "2019-08-24T14:15:22Z",
    "validUntil": "2019-08-24T14:15:22Z",
    "maxRedemptions": 0,
    "timesRedeemed": 0,
    "oncePerCustomer": true,
    "firstTimeCustomerOnly": true,
    "highRisk": true,
    "status": "STATUS_UNSPECIFIED",
    "timestamps": {
      "createTime": "2019-08-24T14:15:22Z",
      "updateTime": "2019-08-24T14:15:22Z"
    },
    "fundedBy": "COUPON_FUNDING_UNSPECIFIED",
    "creditValidDays": 0
  },
  "code": {
    "id": "string",
    "couponId": "string",
    "code": "string",
    "maxRedemptions": 0,
    "timesRedeemed": 0,
    "validFrom": "2019-08-24T14:15:22Z",
    "validUntil": "2019-08-24T14:15:22Z",
    "customerOrgIds": [
      "string"
    ],
    "campaign": "string",
    "channel": "string",
    "batchId": "string",
    "status": "STATUS_UNSPECIFIED",
    "timestamps": {
      "createTime": "2019-08-24T14:15:22Z",
      "updateTime": "2019-08-24T14:15:22Z"
    }
  }
}