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,
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/estimate/notecard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.thanks.io/api/v2/estimate/notecard \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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,
"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"
}
]
}
'import requests
url = "https://api.thanks.io/api/v2/estimate/notecard"
payload = {
"front_image_url": "https://cdn.thanks.io/notecard-inspirations/note1.png",
"message": "Hey %FIRST_NAME%!,
THANK YOU for allowing us the opportunity to HELP you with your plan!",
"handwriting_style_id": 4,
"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"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message": "OK",
"data": {
"type": "notecard",
"size": null,
"total_recipients": 2,
"recipients": {
"united_states": 2,
"international": 0
},
"pending_email_lookups": 0,
"costs_in_cents": {
"united_states": 236,
"international": 0,
"additional_pages": 0,
"giftcard_face_value": 0,
"grand_total": 236
},
"total_cost_in_cents": 236,
"total_cost": "$2.36",
"current_balance_in_cents": 5000,
"covered_by_balance": true,
"test_mode": false,
"notes": []
}
}{
"message": "Sub Account ID does not exist"
}{
"message": "Unauthorized"
}{
"status": "API access has been temporarily disabled due to repeated payment failures. Please update your payment method.",
"message": "API access has been temporarily disabled due to repeated payment failures. Please update your payment method.",
"code": "api_disabled_payment_failures"
}Estimate Notecard
Price a notecard order without placing it. Send the same request body you would send to Send Notecard: nothing is charged, nothing is printed or mailed, and no order is created.
The request is validated exactly as the send is, so a payload the send would reject is rejected here too. Recipients with only an email address are priced as if the email-to-address lookup finds them, and counted in pending_email_lookups. A radius_search is counted and priced, but no records are purchased.
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,
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/estimate/notecard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.thanks.io/api/v2/estimate/notecard \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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,
"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"
}
]
}
'import requests
url = "https://api.thanks.io/api/v2/estimate/notecard"
payload = {
"front_image_url": "https://cdn.thanks.io/notecard-inspirations/note1.png",
"message": "Hey %FIRST_NAME%!,
THANK YOU for allowing us the opportunity to HELP you with your plan!",
"handwriting_style_id": 4,
"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"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message": "OK",
"data": {
"type": "notecard",
"size": null,
"total_recipients": 2,
"recipients": {
"united_states": 2,
"international": 0
},
"pending_email_lookups": 0,
"costs_in_cents": {
"united_states": 236,
"international": 0,
"additional_pages": 0,
"giftcard_face_value": 0,
"grand_total": 236
},
"total_cost_in_cents": 236,
"total_cost": "$2.36",
"current_balance_in_cents": 5000,
"covered_by_balance": true,
"test_mode": false,
"notes": []
}
}{
"message": "Sub Account ID does not exist"
}{
"message": "Unauthorized"
}{
"status": "API access has been temporarily disabled due to repeated payment failures. Please update your payment method.",
"message": "API access has been temporarily disabled due to repeated payment failures. Please update your payment method.",
"code": "api_disabled_payment_failures"
}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 notecard. Required if not front_image_url is specified.
6
URL to image to use for the exterior of the notecard. Required if image_template_id is not specified.
"https://cdn.thanks.io/notecard-inspirations/note1.png"
Handwritten message content to use for interior of notecard.
"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 notecard.
12
Use custom interior background image. This can be used to turn off the default background image.
URL to custom background image to use for interior of notecard. This image will be placed behind the handwritten message. Must be 1650px by 2475px.
"https://s3.amazonaws.com/content.thanks.io/templates/branding-builder-images/c09d39aadfc-3701d4467b8/44e9a510-78cb-11f0-a77d-dd13e72edce5.png"
URL to Autogenerate QR Code in interior of notecard.
"https://www.google.com"
Was this page helpful?