Skip to main content
GET
/
v1
/
discounts
TypeScript SDK
import { Solifyn } from 'solifyn';

const solifyn = new Solifyn({ apiKey: 'your_private_api_key_here' });

// List and query discounts
const discounts = await solifyn.discounts.list({
  limit: 10
});
console.log('Discounts:', discounts);
{
  "items": [
    {
      "id": "disc_cs8f67sd7f6fw3fs",
      "discount_id": "disc_cs8f67sd7f6fw3fs",
      "code": "<string>",
      "amount": 123,
      "usageLimit": 123,
      "timesUsed": 123,
      "expiresAt": "2023-11-07T05:31:56Z",
      "businessId": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "name": "<string>"
    }
  ],
  "total": 123,
  "total_count": 123,
  "pagination": {
    "total": 123,
    "total_count": 123,
    "max_page": 123
  }
}

Authorizations

Authorization
string
header
required

Authenticate requests using your standard bearer API key (e.g. YOUR_API_KEY).

Query Parameters

sorting
enum<string>

Sorting criterion. Add a minus sign - before the criteria name to sort by descending order.

Available options:
created_at,
-created_at
limit
number
default:10

Size of a page, defaults to 10. Maximum is 100.

page
number
default:1

Page number, defaults to 1.

query
string

Filter by discount code (fuzzy, case-insensitive).

id
string

Filter by discount ID.

Response

200 - application/json

Successfully retrieved discounts list.

items
object[]
required
total
integer
required

Total number of items matching filters.

total_count
integer
required

Total number of items matching filters (alias).

pagination
object
required