Coupons allows to apply different types of discounts to Invoices, Orders and Plans. Redeemed Coupons will be applied only to Invoices with the same currency.
limit | integer [ 0 .. 1000 ] The collection items limit. |
offset | integer >= 0 The collection items offset. |
filter | string The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format. |
q | string The partial search of the text fields. |
sort | Array of strings The collection items sort field and order (prefix with "-" for descending sort). |
Coupons redemptions were retrieved successfully.
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
Unauthorized access, invalid credentials were used.
Access forbidden.
$couponRedemptions = $client->couponsRedemptions()->search([ 'filter' => 'customerId:testCustomer', ]);
[- {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "couponId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "customerId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "additionalRestrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "createdTime": "2019-08-24T14:15:22Z",
- "canceledTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
]
Redeem a coupon.
Coupon was redeemed.
Unauthorized access, invalid credentials were used.
Access forbidden.
Invalid data was sent.
{- "couponId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "customerId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "additionalRestrictions": [
- {
- "type": "discounts-per-redemption"
}
]
}
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "couponId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "customerId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "additionalRestrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "createdTime": "2019-08-24T14:15:22Z",
- "canceledTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Retrieve a coupon redemption with specified identifier string.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
$couponRedemption = $client->couponsRedemptions()->load('redemptionId');
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "couponId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "customerId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "additionalRestrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "createdTime": "2019-08-24T14:15:22Z",
- "canceledTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Cancel a coupon redemption.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
$client->couponsRedemptions()->cancel('id');
{- "status": 401,
- "title": "string",
- "detail": "string",
- "instance": "string"
}
Retrieve a list of coupons.
limit | integer [ 0 .. 1000 ] The collection items limit. |
offset | integer >= 0 The collection items offset. |
filter | string The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format. |
q | string The partial search of the text fields. |
sort | Array of strings The collection items sort field and order (prefix with "-" for descending sort). |
A list of coupons was retrieved successfully.
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
Unauthorized access, invalid credentials were used.
Access forbidden.
$coupons = $client->coupons()->search([ 'filter' => 'status:issued', ]);
[- {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "discount": {
- "type": "fixed",
- "context": "items"
}, - "restrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "redemptionsCount": 0,
- "status": "draft",
- "description": "string",
- "issuedTime": "2019-08-24T14:15:22Z",
- "expiredTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
]
Create a coupon.
Coupon resource.
required | object (Discount) | ||||||||||||||||
| |||||||||||||||||
issuedTime required | string <date-time> Coupon's issued time (start time). | ||||||||||||||||
Array of objects (CouponRestriction) Coupon restrictions. | |||||||||||||||||
description | string Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'. | ||||||||||||||||
expiredTime | string <date-time> Coupon's expire time (end time). |
Coupon was created.
required | object (Discount) | ||||||||||||||||
| |||||||||||||||||
issuedTime required | string <date-time> Coupon's issued time (start time). | ||||||||||||||||
id | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||||||||||||||
Array of objects (CouponRestriction) Coupon restrictions. | |||||||||||||||||
redemptionsCount | integer >= 0 Coupon's redemptions count. | ||||||||||||||||
status | string If coupon enabled. | ||||||||||||||||
description | string Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'. | ||||||||||||||||
expiredTime | string <date-time> Coupon's expire time (end time). | ||||||||||||||||
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
Array of objects (SelfLink) non-empty The links related to resource. | |||||||||||||||||
Unauthorized access, invalid credentials were used.
Access forbidden.
Invalid data was sent.
{- "discount": {
- "type": "fixed",
- "context": "items"
}, - "restrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "description": "string",
- "issuedTime": "2019-08-24T14:15:22Z",
- "expiredTime": "2019-08-24T14:15:22Z"
}
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "discount": {
- "type": "fixed",
- "context": "items"
}, - "restrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "redemptionsCount": 0,
- "status": "draft",
- "description": "string",
- "issuedTime": "2019-08-24T14:15:22Z",
- "expiredTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Retrieve a coupon with specified coupon ID string.
Coupon was retrieved successfully.
required | object (Discount) | ||||||||||||||||
| |||||||||||||||||
issuedTime required | string <date-time> Coupon's issued time (start time). | ||||||||||||||||
id | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||||||||||||||
Array of objects (CouponRestriction) Coupon restrictions. | |||||||||||||||||
redemptionsCount | integer >= 0 Coupon's redemptions count. | ||||||||||||||||
status | string If coupon enabled. | ||||||||||||||||
description | string Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'. | ||||||||||||||||
expiredTime | string <date-time> Coupon's expire time (end time). | ||||||||||||||||
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
Array of objects (SelfLink) non-empty The links related to resource. | |||||||||||||||||
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
$coupon = $client->coupons()->load('couponId');
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "discount": {
- "type": "fixed",
- "context": "items"
}, - "restrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "redemptionsCount": 0,
- "status": "draft",
- "description": "string",
- "issuedTime": "2019-08-24T14:15:22Z",
- "expiredTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Create or update a coupon with predefined coupon ID.
Coupon resource.
required | object (Discount) | ||||||||||||||||
| |||||||||||||||||
issuedTime required | string <date-time> Coupon's issued time (start time). | ||||||||||||||||
Array of objects (CouponRestriction) Coupon restrictions. | |||||||||||||||||
description | string Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'. | ||||||||||||||||
expiredTime | string <date-time> Coupon's expire time (end time). |
Coupon was updated.
required | object (Discount) | ||||||||||||||||
| |||||||||||||||||
issuedTime required | string <date-time> Coupon's issued time (start time). | ||||||||||||||||
id | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||||||||||||||
Array of objects (CouponRestriction) Coupon restrictions. | |||||||||||||||||
redemptionsCount | integer >= 0 Coupon's redemptions count. | ||||||||||||||||
status | string If coupon enabled. | ||||||||||||||||
description | string Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'. | ||||||||||||||||
expiredTime | string <date-time> Coupon's expire time (end time). | ||||||||||||||||
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
Array of objects (SelfLink) non-empty The links related to resource. | |||||||||||||||||
Coupon was created.
required | object (Discount) | ||||||||||||||||
| |||||||||||||||||
issuedTime required | string <date-time> Coupon's issued time (start time). | ||||||||||||||||
id | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||||||||||||||
Array of objects (CouponRestriction) Coupon restrictions. | |||||||||||||||||
redemptionsCount | integer >= 0 Coupon's redemptions count. | ||||||||||||||||
status | string If coupon enabled. | ||||||||||||||||
description | string Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'. | ||||||||||||||||
expiredTime | string <date-time> Coupon's expire time (end time). | ||||||||||||||||
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
Array of objects (SelfLink) non-empty The links related to resource. | |||||||||||||||||
Unauthorized access, invalid credentials were used.
Resource was not found.
Conflict.
Invalid data was sent.
{- "discount": {
- "type": "fixed",
- "context": "items"
}, - "restrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "description": "string",
- "issuedTime": "2019-08-24T14:15:22Z",
- "expiredTime": "2019-08-24T14:15:22Z"
}
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "discount": {
- "type": "fixed",
- "context": "items"
}, - "restrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "redemptionsCount": 0,
- "status": "draft",
- "description": "string",
- "issuedTime": "2019-08-24T14:15:22Z",
- "expiredTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Set a coupon's expiration time with the specified coupon ID. The expiredTime of a coupon must be greater than its issuedTime. This cannot be performed on expired coupons.
Coupon resource.
Coupon expiration was successfully set.
required | object (Discount) | ||||||||||||||||
| |||||||||||||||||
issuedTime required | string <date-time> Coupon's issued time (start time). | ||||||||||||||||
id | string <= 50 characters The resource ID. Defaults to UUID v4. | ||||||||||||||||
Array of objects (CouponRestriction) Coupon restrictions. | |||||||||||||||||
redemptionsCount | integer >= 0 Coupon's redemptions count. | ||||||||||||||||
status | string If coupon enabled. | ||||||||||||||||
description | string Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'. | ||||||||||||||||
expiredTime | string <date-time> Coupon's expire time (end time). | ||||||||||||||||
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. | ||||||||||||||||
Array of objects (SelfLink) non-empty The links related to resource. | |||||||||||||||||
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
The coupon is already expired and has been redeemed, unable to. reschedule expiration.
Invalid data was sent.
{- "expiredTime": "2019-08-24T14:15:22Z"
}
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "discount": {
- "type": "fixed",
- "context": "items"
}, - "restrictions": [
- {
- "type": "discounts-per-redemption"
}
], - "redemptionsCount": 0,
- "status": "draft",
- "description": "string",
- "issuedTime": "2019-08-24T14:15:22Z",
- "expiredTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}