JavaScript
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const couponListResponse of client.v1.coupons.list()) {
console.log(couponListResponse.id);
}import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
page = client.v1.coupons.list()
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.V1.Coupons.List(context.TODO(), stigg.V1CouponListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.coupons.CouponListPage;
import io.stigg.models.v1.coupons.CouponListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
CouponListPage page = client.v1().coupons().list();
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
page = stigg.v1.coupons.list
puts(page)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Coupons;
StiggClient client = new();
CouponListParams parameters = new();
var page = await client.V1.Coupons.List(parameters);
await foreach (var item in page.Paginate())
{
Console.WriteLine(item);
}stigg v1:coupons list \
--api-key 'My API Key'curl --request GET \
--url https://api.stigg.io/api/v1/coupons \
--header 'X-API-KEY: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/coupons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"type": "FIXED",
"status": "ACTIVE",
"source": "STIGG",
"percentOff": 50,
"amountsOff": [
{
"amount": 123,
"currency": "usd"
}
],
"billingId": "<string>",
"billingLinkUrl": "<string>",
"durationInMonths": 2,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"next": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prev": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Coupons
Get a list of coupons
Retrieves a paginated list of coupons in the environment.
GET
/
api
/
v1
/
coupons
JavaScript
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const couponListResponse of client.v1.coupons.list()) {
console.log(couponListResponse.id);
}import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
page = client.v1.coupons.list()
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.V1.Coupons.List(context.TODO(), stigg.V1CouponListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.coupons.CouponListPage;
import io.stigg.models.v1.coupons.CouponListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
CouponListPage page = client.v1().coupons().list();
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
page = stigg.v1.coupons.list
puts(page)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Coupons;
StiggClient client = new();
CouponListParams parameters = new();
var page = await client.V1.Coupons.List(parameters);
await foreach (var item in page.Paginate())
{
Console.WriteLine(item);
}stigg v1:coupons list \
--api-key 'My API Key'curl --request GET \
--url https://api.stigg.io/api/v1/coupons \
--header 'X-API-KEY: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/coupons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"type": "FIXED",
"status": "ACTIVE",
"source": "STIGG",
"percentOff": 50,
"amountsOff": [
{
"amount": 123,
"currency": "usd"
}
],
"billingId": "<string>",
"billingLinkUrl": "<string>",
"durationInMonths": 2,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"next": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prev": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}