{
"error": "Error message",
"code": "ERROR_CODE"
}
Common Error Codes
| HTTP | Code | Description |
|---|
| 400 | VALIDATION_ERROR | Request parameter validation failed |
| 400 | BAD_REQUEST | Invalid request |
| 401 | UNAUTHORIZED | Authentication failed (API key error) |
| 403 | FORBIDDEN | Access denied |
| 404 | NOT_FOUND | Resource not found |
| 409 | CONFLICT | Duplicate resource |
| 500 | INTERNAL_ERROR | Internal server error |
All date/time values must be sent in ISO 8601 format in UTC timezone.
Format
Example
{
"purchasedAt": "2024-01-15T10:30:00.000Z"
}
| Component | Description | Example |
|---|
YYYY-MM-DD | Date (year-month-day) | 2024-01-15 |
T | Date and time separator | T |
HH:mm:ss | Time (hour:minute:second) | 10:30:00 |
.sss | Milliseconds (optional) | .000 |
Z | UTC timezone indicator | Z |
Send times in UTC, not local timezone. For example, 7:30 PM KST (Korea Standard Time, UTC+9) should be sent as 10:30 AM UTC (10:30:00Z).
Language Examples
// JavaScript
const now = new Date();
const isoString = now.toISOString();
// "2024-01-15T10:30:00.000Z"
# Python
from datetime import datetime, timezone
now = datetime.now(timezone.utc)
iso_string = now.isoformat(timespec='milliseconds').replace('+00:00', 'Z')
# "2024-01-15T10:30:00.000Z"
// Java
import java.time.Instant;
String isoString = Instant.now().toString();
// "2024-01-15T10:30:00.000Z"
Server API Endpoints
| Function | Method | Endpoint |
|---|
| Sponsor | | |
| Create/Update sponsor | POST | /v1/server/sponsors |
| Get sponsor status | GET | /v1/server/sponsors/user/:userId |
| Remove sponsor | DELETE | /v1/server/sponsors/user/:userId |
| Payment | | |
| Create payment | POST | /v1/server/payments |
| Get payment | GET | /v1/server/payments/:transactionId |
| Get user payments | GET | /v1/server/payments/user/:userId |
| Refund payment | POST | /v1/server/payments/:transactionId/refund |
| Coupon | | |
| Validate coupon | POST | /v1/server/coupons/validate |
| Redeem coupon | POST | /v1/server/coupons/redeem |
| Get user coupons | GET | /v1/server/coupons/user/:userId |
| Query | | |
| List campaigns | GET | /v1/server/campaigns |
| Get campaign | GET | /v1/server/campaigns/:id |
| Search creators | GET | /v1/server/creators/search |
| Get creator | GET | /v1/server/creators/:creatorKey |
| Get creator coupons | GET | /v1/server/creators/:creatorKey/coupons |
| Webhook | | |
| List webhooks | GET | /v1/server/webhooks |
| Create webhook | POST | /v1/server/webhooks |
| Update webhook | PUT | /v1/server/webhooks/:id |
| Delete webhook | DELETE | /v1/server/webhooks/:id |
| Get webhook logs | GET | /v1/server/webhooks/:id/logs |
| Test webhook | POST | /v1/server/webhooks/:id/test |
Client API Endpoints
| Function | Method | Endpoint |
|---|
| Campaign | | |
| List campaigns | GET | /v1/client/campaigns |
| Get campaign | GET | /v1/client/campaigns/:id |
| List campaign creators | GET | /v1/client/campaigns/:id/creators |
| List campaign packages | GET | /v1/client/campaigns/:id/packages |
| Creator | | |
| Search creators | GET | /v1/client/creators/search |
| Get creator | GET | /v1/client/creators/:creatorKey |
| Coupon | | |
| Validate coupon | POST | /v1/client/coupons/validate |
| Sponsor | | |
| Get sponsor status | GET | /v1/client/sponsors |