Promotions API
Manage discounts, promotions, and marketing campaigns
11 endpoints
Base URL:
https://api.nexapay.com/v1| Method | Path | Description |
|---|---|---|
| GET | /promotions | List all promotions |
| POST | /promotions | Create promotion |
| GET | /promotions/{promotion_id} | Get promotion details |
| PUT | /promotions/{promotion_id} | Update promotion |
| DELETE | /promotions/{promotion_id} | Delete promotion |
| GET | /promotions/codes | List discount codes |
| POST | /promotions/codes | Create discount code |
| POST | /promotions/codes/validate | Validate discount code |
| GET | /promotions/campaigns | List campaigns |
| POST | /promotions/campaigns | Create campaign |
| GET | /promotions/campaigns/{campaign_id} | Get campaign details |
Detailed Examples
POST
/promotionsRequest Body
{
"name": "Happy Hour Special",
"type": "percentage",
"value": 20,
"start_date": "2024-01-20T14:00:00Z",
"end_date": "2024-01-20T17:00:00Z",
"applicable_products": ["prod_coffee", "prod_tea"],
"stores": ["store_abc123"],
"conditions": {
"min_purchase": 10,
"days_of_week": ["monday", "tuesday", "wednesday", "thursday", "friday"]
},
"max_uses_per_customer": 1,
"total_uses_limit": 500
}Response
{
"success": true,
"data": {
"id": "promo_happy_hour",
"name": "Happy Hour Special",
"type": "percentage",
"discount": "20%",
"status": "scheduled",
"valid_from": "2024-01-20T14:00:00Z",
"valid_until": "2024-01-20T17:00:00Z",
"created_at": "2024-01-15T10:00:00Z"
}
}