There are times when just a gift link to the untie page (redemption page with card and product selection) will suffice, and no email is needed. We'll walk through the creation of a gift link that can be embedded in a customer service email.
curl -i https://api.loopandtie.com/v1/teams/sandbox/gifts \
-H "Authorization: Bearer [[app:key]]" \
-H "Content-Type: application/json" \
-X POST \
-d '{"gift":
{
"name": "Ziggi",
"collection": "$25",
"message": "Better than Bob",
"from": "Peter Tosh",
"delivery_method": "link"
}
}'
In the call above, notice that there is neither an email
attribute nor a scheduled_at
attribute. Instead, we set delivery_method
to link
and get the JSON payload below, that includes untie-url
{
"data": {
"id": "GBB8C23A5511A",
"type": "gifts",
"attributes": {
"external-id": "GBB8C23A5511A",
"team": "sandbox",
"sender-name": "Dimitri Roche",
"untie-url": "http://www.loopandtie.com/untie/JjUxxxxxxx",
"delivery-method": "link",
"email": null,
"scheduled-at": null,
"stage": "scheduled",
"last-event-at": "2015-11-13T20:39:45.911Z",
"subject":"Peter Sent You A Gift!",
"message": "Better than Bob",
"from": "Peter Tosh",
"thank-you-note": null,
"selected-product": null,
"variant": null,
"redemption-email": null,
"address": null,
"events": [
{
"stage": "scheduled",
"message": null,
"created-at": "2015-11-13T20:39:45.917Z"
}
]
},
"relationships": {
"sender": {
"data": {
"id": "1",
"type": "users"
}
},
"collection": {
"data": {
"id": "4",
"type": "collections"
}
},
"logo": {
"data": {
"id": "126",
"type": "logos"
}
},
"design": {
"data": {
"id": "standard-gift-of-choice-v2",
"type": "designs"
}
}
}
},
"included": [
{
"id": "1",
"type": "users",
"attributes": {
"name": "Dimitri Roche",
"email": "[email protected]"
}
},
{
"id": "4",
"type": "collections",
"attributes": {
"name": "$25",
"global": true,
"price": "25.00"
}
},
{
"id": "126",
"type": "logos",
"attributes": {
"name": "Loop & Tie",
"global": true,
"image-url": "https://d2ncrfzc0pt6uh.cloudfront.net/uploads/logos/2387/1531343620/standard.png?1531343620"
}
},
{
"id": "standard-gift-of-choice-v2",
"type": "designs",
"attributes": {
"name": "Standard Gift Of Choice v2",
"global": true,
"has-logo": true,
"image-url": "https://d2ncrfzc0pt6uh.cloudfront.net/uploads/designs/8/1441980212/uploads/standard.jpg?1441980212",
"thumbnail-url": "https://d2ncrfzc0pt6uh.cloudfront.net/uploads/designs/8/1441980212/uploads/thumbnail.jpg?1441980212"
}
}
]
}
Now that we have an untie_url ("https://www.loopandtie.com/untie/JjUxxxxxxx"), we can visit it directly or just add it as a hyperlink in an email.