const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
front_image_url: 'https://cdn.thanks.io/notecard-inspirations/note1.png',
message: 'Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!',
handwriting_style_id: 4,
giftcard_brand: 'amazonus',
giftcard_amount_in_cents: 10000,
recipients: [
{
name: 'Current Resident',
address: '123 Main Street',
city: 'Fake City',
province: 'NY',
postal_code: '55555',
country: 'US',
custom1: 'Example Custom 1',
custom2: 'Example Custom 2',
custom3: 'Example Custom 3',
custom4: 'Example Custom 4'
},
{
name: 'Jane Doe',
address: '456 Another St',
city: 'Fake City',
province: 'NY',
postal_code: '55555',
country: 'US'
}
]
})
};
fetch('https://api.thanks.io/api/v2/send/giftcard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"total_estimated_recipients": 1,
"authorization_total": 179,
"leads_fee": 0,
"mailing_list_ids_used": "",
"handwriting_color": "#000001",
"front_image": "https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645532.png",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"append_or_current_resident": true,
"type": "giftcard",
"return_name": null,
"return_address": null,
"return_address2": null,
"return_city": null,
"return_province": null,
"return_postal_code": null,
"message_template_id": null,
"image_template_id": 6,
"method": "api",
"sub_account_id": null,
"font_size": "auto",
"qrcode_url": null,
"custom_background_url": null,
"giftcard_brand": "amazonus",
"giftcard_image": "https://cdn.thanks.io/giftcards/amazonus.png",
"giftcard_amount": 10000,
"status": "reviewing",
"addons": {
"standardmail": "on"
},
"style": 4,
"user_id": 2,
"updated_at": "2025-09-02 18:25:44",
"created_at": "2025-09-02 18:25:44",
"id": 42696,
"display_status": "Reviewing",
"display_trigger": "API",
"display_type": "Giftcard",
"giftcard_brand_longname": "Amazon.com",
"sub_account": null,
"recipients": [
{
"name": "Current Resident",
"address": "1 Main Street",
"city": "Anytown",
"province": "NY",
"postal_code": "55555",
"country": "US",
"address2": ""
}
]
}Send Giftcard
Send a folded 4.25x5.5 giftcard in envelope.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
front_image_url: 'https://cdn.thanks.io/notecard-inspirations/note1.png',
message: 'Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!',
handwriting_style_id: 4,
giftcard_brand: 'amazonus',
giftcard_amount_in_cents: 10000,
recipients: [
{
name: 'Current Resident',
address: '123 Main Street',
city: 'Fake City',
province: 'NY',
postal_code: '55555',
country: 'US',
custom1: 'Example Custom 1',
custom2: 'Example Custom 2',
custom3: 'Example Custom 3',
custom4: 'Example Custom 4'
},
{
name: 'Jane Doe',
address: '456 Another St',
city: 'Fake City',
province: 'NY',
postal_code: '55555',
country: 'US'
}
]
})
};
fetch('https://api.thanks.io/api/v2/send/giftcard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"total_estimated_recipients": 1,
"authorization_total": 179,
"leads_fee": 0,
"mailing_list_ids_used": "",
"handwriting_color": "#000001",
"front_image": "https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645532.png",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"append_or_current_resident": true,
"type": "giftcard",
"return_name": null,
"return_address": null,
"return_address2": null,
"return_city": null,
"return_province": null,
"return_postal_code": null,
"message_template_id": null,
"image_template_id": 6,
"method": "api",
"sub_account_id": null,
"font_size": "auto",
"qrcode_url": null,
"custom_background_url": null,
"giftcard_brand": "amazonus",
"giftcard_image": "https://cdn.thanks.io/giftcards/amazonus.png",
"giftcard_amount": 10000,
"status": "reviewing",
"addons": {
"standardmail": "on"
},
"style": 4,
"user_id": 2,
"updated_at": "2025-09-02 18:25:44",
"created_at": "2025-09-02 18:25:44",
"id": 42696,
"display_status": "Reviewing",
"display_trigger": "API",
"display_type": "Giftcard",
"giftcard_brand_longname": "Amazon.com",
"sub_account": null,
"recipients": [
{
"name": "Current Resident",
"address": "1 Main Street",
"city": "Anytown",
"province": "NY",
"postal_code": "55555",
"country": "US",
"address2": ""
}
]
}Authorizations
Bearer token authentication using your thanks.io API key
Body
Set to true to return a preview instead of sending the mail piece. You can use this with any send call to inspect the output before submitting the order.
true
Mailing list IDs to send to. Required if recipients and radius_search are not provided.
[5166, 514]
Recipients to send to. Required if mailing_list_ids and radius_search are not provided.
Create a recipient by providing address details
- Create Recipient by Address
- Create Recipient by Email
Show child attributes
Show child attributes
Use a radius search to find recipients near an address. Required if mailing_list_ids and recipients are not provided. Lookup fees are $0.05 per record.
Show child attributes
Show child attributes
ID of handwriting style to use.
4
Handwriting color to use. Options are preset named colors or specified as hex format, such as '#4287f5'
blue, black, green, purple, red "blue"
"#4287f5"
Set to true to enable the realism effect for AI fonts.
true
Sub-account ID to use for this order.
7
Optional comma-separated list of email addresses to notify about order events such as QR scan notifications.
"ops@example.com,sales@example.com"
Postage class for this order. first_class mails First Class. standard mails Standard Mail (also known as Marketing Mail): lower cost for US addresses and slower to deliver, with no tracking status and no return-to-sender. Omit it to use your account's default, set with Standard Mail Mode under Settings > Mail Preferences. Standard Mail only changes the price of US addresses. Nonprofit accounts always mail at their nonprofit rate. standard needs a paid plan: free plan accounts always mail First Class, and standard from one is rejected with a 422.
first_class, standard "standard"
Custom return name for the order.
"Custom Return"
Custom return address for the order.
"1 Main Street"
Custom return address line 2 for the order.
"Unit 1"
Custom return city for the order.
"Woodbridge"
Custom return state/province for the order.
"NJ"
Custom return postal code for the order.
"07095"
Your own key/value data to store with the order. It is returned unchanged by the order endpoints and included in every webhook event for the order as order.metadata. Must be a JSON object rather than an array, and no larger than 8,192 bytes once encoded as JSON. thanks.io does not print or otherwise act on these values.
{
"crm_deal_id": "D-1042",
"campaign": "spring-winback",
"source": "hubspot"
}
Recommended: send a saved creative instead of assembling image and message parameters per request. ID of a creative from your Creatives library (see List Creatives). The creative is sent exactly as saved: its image template, message template, handwriting and background all come from it. It cannot be combined with any parameter that changes those (image_template_id, message_template_id, front_image_url, message, the handwriting and custom background parameters, pdf_only_url, skip_creative_generation, or for gift cards giftcard_brand and giftcard_amount_in_cents); a request that does is rejected with a 422 naming them. Only qrcode_url and additional_pages_url can be added. The creative must belong to your account, be of the mailer type being sent (for postcards, the size being sent), and be complete (is_complete: true).
501
ID of image template to use for the exterior of the giftcard. Required if not front_image_url is specified.
6
URL to image to use for the exterior of the giftcard. Required if image_template_id is not specified.
"https://cdn.thanks.io/notecard-inspirations/note1.png"
Handwritten message content to use for interior of giftcard.
"Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!"
ID of message template to use for interior of giftcard.
12
Brand of giftcard to use. Must be one of the supported brands. The /giftcard-brands endpoint can be used to retrieve a list of supported brands. Leave this out when sending a creative_id: a gift card creative carries its own brand and amount, and passing this with it is rejected with a 422.
"amazonus"
Amount of giftcard in cents. The /giftcard-brands endpoint can be used to retrieve a list of supported amounts by brand. Leave this out when sending a creative_id: a gift card creative carries its own brand and amount, and passing this with it is rejected with a 422.
10000
Response
Send Mailer Success
- Send Mailer Order Submitted Response
- Send Mailer Preview Response
Response when an Order is successfully submitted to Send Mailer
Unique identifier for the order
42664
User ID for the order
2
Sub-account Info For Order. Can be null
Show child attributes
Show child attributes
Sub account ID for the order
12345
Total estimated recipients for the order
1
Total authorization amount for the order in cents
58
Total leads fee for the order in cents
99
Mailing lists used for the order. Can be null if recipients or radius search is used.
"3046,3020"
List of recipients for the order
Show child attributes
Show child attributes
Front image URL for the order
"https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645532.png"
Image template ID for the order
6
Custom background URL for the order. Only valid for postcard backs and the interior background of notecards and giftcards.
"https://s3.amazonaws.com/content.thanks.io/templates/branding-builder-images/c09d39aadfc-3701d4467b8/4524cce0-78cb-11f0-b937-17570cbedaf4.png"
Message content for the order
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
Message template ID for the order
12345
Handwriting color to use
"rgba(31,0,113,0.80)"
Font size for the order
auto, small, medium, large "auto"
Handwriting style ID for the order
4
Appended "Or Current Resident" for the order. This is helpful if you want to ensure delivery.
false
Return name for the order
"John Doe"
Return address line 1 for the order
"123 Main Street"
Return address line 2 for the order
null
Return city for the order
"Anytown"
Return state/province for the order
"NY"
Return postal code for the order
"12345"
Type of the order
postcard, postcard6x9, postcard6x11, letter, notecard, giftcard, windowlessletter "postcard"
Size of the order (valid for postcards only)
4x6, 6x9, 6x11 "4x6"
Method for the order
api, cardbuilder, drip, email, zapier Status of the order
reviewing, processing, fulfilled, cancelled, printed, shipped, paused, delivered Display status for the order
"Reviewing"
Display trigger for the order
"API"
Display type for the order
"Postcard-4x6"
Add-ons for the order
Show child attributes
Show child attributes
QR code URL for the order
"https://www.google.com?name=~FULL_NAME~&custom_field_1=~CUSTOM1~&custom_field2=~CUSTOM2~"
Gift card brand for the order (valid for Giftcard orders only)
null
Gift card image URL for the order (valid for Giftcard orders only)
null
Gift card amount for the order in cents (valid for Giftcard orders only)
null
Gift card brand long name for the order (valid for Giftcard orders only)
"Amazon.com"
The metadata object submitted with the order, returned exactly as it was sent. Null when the order was created without metadata.
{
"crm_deal_id": "D-1042",
"campaign": "spring-winback",
"source": "hubspot"
}
Last updated timestamp for the order
"2025-08-14 16:42:44"
Creation timestamp for the order
"2025-08-14 16:42:44"
Was this page helpful?