cURL
curl --request POST \ --url https://api.givebutter.com/v1/campaigns/{campaign}/discount-codes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "type": "percentage", "active": true, "amount": 2, "code": "<string>", "items": [ "<string>" ], "uses": 2, "starts_at": "2023-11-07T05:31:56Z", "expires_at": "2023-11-07T05:31:56Z" } '
{ "id": 123, "campaign_id": 123, "code": "<string>", "type": "<string>", "amount": 123, "used": 123, "uses": 123, "active": true, "total_discount": "<string>", "starts_at": "<string>", "expires_at": "<string>", "created_at": "<string>", "updated_at": "<string>", "items": [ "<unknown>" ], "all_items": true }
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
The campaign ID
percentage
fixed
x >= 1
255
CampaignDiscountCodeResource
Was this page helpful?