Endpoints related to authentication and authorization
Corksy API (1.2.0)
API for retrieving orders, customers, inventory, wine-club data, and products.
First, generate your API key from the Admin Settings API page:
- Go to: https://admin.corksy.io/settings/apiaccess
- Create a new API key for your application
Use your API key to obtain a bearer token by making a POST request to the authentication endpoint:
Production:
curl --location 'https://connect-api.corksy.io/v1/auth/public/login' \
--header 'Content-Type: application/json' \
--data '{
"apiKey": "your-api-key-here"
}'Staging:
curl --location 'https://staging.corksy.io/connect-api/v1/v1/auth/public/login' \
--header 'Content-Type: application/json' \
--data '{
"apiKey": "your-api-key-here"
}'Response:
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 1800000
}Use the accessToken from the response as a Bearer token in the Authorization header for all subsequent API requests:
Example Requests:
Get Orders:
curl --location 'https://connect-api.corksy.io/v1/orders?modifiedFromDate=2025-05-01&modifiedToDate=2025-05-31' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'Get Customers:
curl --location 'https://connect-api.corksy.io/v1/customers' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'Get Inventory:
curl --location 'https://connect-api.corksy.io/v1/inventory' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'Get Wine Clubs:
curl --location 'https://connect-api.corksy.io/v1/wine-clubs' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'Get Wine Club Members:
curl --location 'https://connect-api.corksy.io/v1/wine-club-members' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'Get Products:
curl --location 'https://connect-api.corksy.io/v1/products?modifiedFromDate=2025-05-01&modifiedToDate=2025-05-31' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'Note: The bearer token expires after 30 minutes (1,800,000 microseconds). You'll need to obtain a new token when it expires.
All list endpoints support pagination to handle large datasets efficiently. The API uses offset-based pagination with the following parameters:
offset(optional): Number of records to skip. Default:0pageSize(optional): Number of records to return per page. Default:1000, Maximum:1000
Each paginated response includes a pagination object with the following information:
{
"data": [...],
"pagination": {
"current_offset": 0,
"page_size": 50,
"total_records": 1250,
"total_pages": 25,
"current_page": 1,
"pages_remaining": 24,
"has_next_page": true,
"has_previous_page": false
}
}First Page (Default):
curl --location 'https://connect-api.corksy.io/v1/orders?modifiedFromDate=2025-05-01&modifiedToDate=2025-05-31' \
--header 'Authorization: Bearer YOUR_TOKEN'Second Page (50 records per page):
curl --location 'https://connect-api.corksy.io/v1/orders?modifiedFromDate=2025-05-01&modifiedToDate=2025-05-31&offset=50&pageSize=50' \
--header 'Authorization: Bearer YOUR_TOKEN'Custom Page Size:
curl --location 'https://connect-api.corksy.io/v1/orders?modifiedFromDate=2025-05-01&modifiedToDate=2025-05-31&pageSize=100' \
--header 'Authorization: Bearer YOUR_TOKEN'