import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const coupon = await client.v1.coupons.retrieve('x');
console.log(coupon.data);{
"data": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"type": "FIXED",
"status": "ACTIVE",
"source": "STIGG",
"percentOff": 123,
"amountsOff": [
{
"amount": 123,
"currency": "usd"
}
],
"billingId": "<string>",
"billingLinkUrl": "<string>",
"durationInMonths": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Retrieves a coupon by its unique identifier.
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const coupon = await client.v1.coupons.retrieve('x');
console.log(coupon.data);{
"data": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"type": "FIXED",
"status": "ACTIVE",
"source": "STIGG",
"percentOff": 123,
"amountsOff": [
{
"amount": 123,
"currency": "usd"
}
],
"billingId": "<string>",
"billingLinkUrl": "<string>",
"durationInMonths": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Server API Key
API Key
The unique identifier of the entity
1 - 255The coupon object with full details.
Response object
Discount instrument with percentage or fixed amount
Show child attributes