cURL
curl --request POST \ --url https://staging-api.puppetvendors.com/discounts \ --header 'Content-Type: application/json' \ --header 'x-access-token: <api-key>' \ --data ' { "code": "<string>", "title": "<string>", "startsAt": "<string>", "endsAt": "<string>", "customerGets": {}, "usageLimit": 123, "appliesOncePerCustomer": true, "items": {} } '
Create a new discount code as a vendor
Documentation IndexFetch the complete documentation index at: https://dev.puppetvendors.com/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: https://dev.puppetvendors.com/llms.txt
Use this file to discover all available pages before exploring further.
{ "success": true, "data": { "discount": { "_id": "507f1f77bcf86cd799439011", "code": "VENDOR20", "title": "Vendor Special 20% Off", "status": "active", "createdAt": "2024-06-15T10:00:00.000Z" } } }
curl -X POST https://staging-api.puppetvendors.com/discounts \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "code": "VENDOR20", "title": "Vendor Special 20% Off", "usageLimit": 50, "appliesOncePerCustomer": true }'
curl -X POST "https://staging-api.puppetvendors.com/discounts" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "code": "SUMMER20", "title": "Summer 20% Off", "customerGets": { "value": { "type": "percentage", "value": 20 } }, "usageLimit": 100, "appliesOncePerCustomer": true, "startsAt": "2026-06-01T00:00:00Z", "endsAt": "2026-08-31T23:59:59Z" }'
curl -X POST "https://staging-api.puppetvendors.com/discounts" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "code": "SAVE10", "title": "$10 Off Any Order", "customerGets": { "value": { "type": "fixed_amount", "value": 10 } } }'
Was this page helpful?