const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/order-items/{orderItemId}/invalidate-giftcard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.thanks.io/api/v2/order-items/{orderItemId}/invalidate-giftcard \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.thanks.io/api/v2/order-items/{orderItemId}/invalidate-giftcard"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text){
"data": {
"id": 2668662,
"status": "Delivered",
"delivery_date": "2025-09-15",
"scans": 0,
"failure": null,
"recipient": {
"name": "Jane Doe",
"company": null,
"address": "456 Another St",
"address2": "",
"city": "Fake City",
"province": "NY",
"postal_code": "55555",
"country": "US",
"email": null,
"phone": null,
"custom1": null,
"custom2": null,
"custom3": null,
"custom4": null,
"custom5": null,
"custom6": null,
"custom7": null,
"custom8": null,
"custom9": null,
"custom10": null
},
"giftcard": {
"brand": "amazonus",
"amount": 2500,
"redeemed_at": null,
"invalidated_at": "2025-09-20T14:02:11.000000Z"
},
"created_at": "2025-09-08T16:05:12.000000Z"
}
}Invalidate Gift Card
Invalidate the gift card on a mailed piece so it can no longer be redeemed, for example when a card was sent by mistake. This does the same as the Invalidate button on the Order Details page, and it can’t be undone. PATCH is accepted as well as PUT.
Only an unredeemed card that hasn’t already been invalidated can be invalidated. The order must belong to the authenticated account.
The response is the updated order item, in the same shape as List Order Items. The redemption code, claim link and rendered card image are never returned.
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thanks.io/api/v2/order-items/{orderItemId}/invalidate-giftcard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.thanks.io/api/v2/order-items/{orderItemId}/invalidate-giftcard \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.thanks.io/api/v2/order-items/{orderItemId}/invalidate-giftcard"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text){
"data": {
"id": 2668662,
"status": "Delivered",
"delivery_date": "2025-09-15",
"scans": 0,
"failure": null,
"recipient": {
"name": "Jane Doe",
"company": null,
"address": "456 Another St",
"address2": "",
"city": "Fake City",
"province": "NY",
"postal_code": "55555",
"country": "US",
"email": null,
"phone": null,
"custom1": null,
"custom2": null,
"custom3": null,
"custom4": null,
"custom5": null,
"custom6": null,
"custom7": null,
"custom8": null,
"custom9": null,
"custom10": null
},
"giftcard": {
"brand": "amazonus",
"amount": 2500,
"redeemed_at": null,
"invalidated_at": "2025-09-20T14:02:11.000000Z"
},
"created_at": "2025-09-08T16:05:12.000000Z"
}
}Authorizations
Bearer token authentication using your thanks.io API key
Path Parameters
ID of the order item whose gift card you want to invalidate. This is the id returned by List Order Items and carried by order item webhook events.
Response
The gift card was invalidated.
A single mail piece within an order — one recipient's postcard, letter, notecard, magnacard or gift card.
Show child attributes
Show child attributes
Was this page helpful?