cURL
curl --request PUT \ --url https://api.givebutter.com/v1/campaigns/{campaign}/discount-codes/{discountCode} \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "amount": 50.5, "items": [ "<string>" ], "type": "percentage", "active": true, "code": "<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
The discount code ID
1 <= x <= 100
percentage
fixed
255
x >= 1
CampaignDiscountCodeResource
Was this page helpful?