Developers
API referenceGift codes

Revoke a gift code

POST
/gift-codes/{id}/revoke

Makes an open code unusable and returns its trees to your unassigned trees. A claimed code cannot be revoked; delete the recipient instead.

Scope: gift-codes:write.

Authorization

bearerAuth
AuthorizationBearer <token>

A Platform API token, wyc_live_... or wyc_test_..., created at Settings > API tokens in the dashboard.

In: header

Path Parameters

id*string

Id of the gift code.

Match^gift_[A-Za-z0-9]{24}$

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/gift-codes/string/revoke"
{  "id": "gift_8bW1vT9yN6pDmQ2xL7rCkZa3",  "object": "gift_code",  "livemode": true,  "code": "WYC-7K3M-PLANT",  "claim_url": "https://woodyou.care/gift/example/WYC-7K3M-PLANT",  "status": "revoked",  "trees": 1,  "project": null,  "sent_to": {    "name": "John Doe",    "email": "john@example.com"  },  "external_reference": "XMAS-2026-0042",  "recipient": null,  "valid_until": "2027-01-31T23:59:59Z",  "claimed_at": null,  "created_at": "2026-12-01T09:00:00Z",  "updated_at": "2026-12-01T09:00:00Z"}