Skip to content

Treazure Coupon - Batch API

Coupon batch endpoints require api_couponmanagement scope.

Batch issue coupons

/api/v1.0/CouponManagement/IssueOnDemand

Use this endpoint to issue coupons to multiple customers at once, in batch. This endpoint is intended for background processes.

{
  "couponDefinition": {
    "id": "string"
  },
  "validFrom": "2024-11-20T12:53:03.250Z",
  "validUntil": "2024-11-20T12:53:03.250Z",
  "customers": [
    {
      "reference": "string"
    }
  ],
  "withoutCustomerReference": 10000
}

This is an async API. After post, use the returned url to poll status. See Long Running Operation

Schema of downloaded data is an array of:

{
  "status": string,
  "barcode": string,
  "serialNumber": string,
  "couponRangeId": string,
  "customerReference": string,
  "createdAt": datetime,
  "validUntill": datetime,
  "validFrom": datetime
}

Batch get coupons

/api/v1.0/CouponManagement/CouponStatusEnquiry

Use this endpoint to get coupon status in batch.

{
  "couponDefinition": {
    "id": "string"
  },
  "expiresBefore": "2024-11-20T12:52:14.063Z",
  "createdAfter": "2024-11-20T12:52:14.063Z",
  "status": "Created"
}

This is an async API. After post, use the returned url to poll status. See Long Running Operation

{
  "links": [
    {
      "href": "url_for_status",
      "rel": "self"
    }
  ]
}

Get coupon definitions

/api/v1.0/CouponManagement/CouponDefinition

Returns existing coupon definitions.

{
  "couponDefinitions": [
    {
      "id": "string",
      "type": "GenericCoupon"
    }
  ]
}