curl --request PATCH \
--url https://api.snappy.com/public-api/v2/gifts/{giftId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"customization": {
"giftProperties": {
"budget": {
"max": 100,
"min": 76
},
"collection": {
"id": "12345678",
"featuredProductId": "12345678"
},
"product": {
"id": "12345678",
"displayType": "displayAsSurprise"
},
"expiration": {
"type": "specificDate",
"date": "2022-12-06T09:50:38.536Z"
},
"guaranteedGift": {
"type": "specificDate",
"date": "2022-12-06T09:50:38.536Z"
}
},
"notificationPolicy": {
"sendingChannels": [
"mail",
"sms"
],
"disableReminders": false
},
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
],
"logo": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
},
"greeting": {
"content": {
"ops": [
{
"attributes": {
"font": "pacifico"
},
"insert": "Happy Birthday!"
}
],
"customProperty": "customValue"
},
"banner": {
"text": "<string>",
"color": "<string>",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
],
"logo": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
}
}
},
"postClaim": {
"redirectAfterClaim": "https://example.com/redirect"
}
}
}
}
'import requests
url = "https://api.snappy.com/public-api/v2/gifts/{giftId}"
payload = { "customization": {
"giftProperties": {
"budget": {
"max": 100,
"min": 76
},
"collection": {
"id": "12345678",
"featuredProductId": "12345678"
},
"product": {
"id": "12345678",
"displayType": "displayAsSurprise"
},
"expiration": {
"type": "specificDate",
"date": "2022-12-06T09:50:38.536Z"
},
"guaranteedGift": {
"type": "specificDate",
"date": "2022-12-06T09:50:38.536Z"
}
},
"notificationPolicy": {
"sendingChannels": ["mail", "sms"],
"disableReminders": False
},
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
],
"logo": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
},
"greeting": {
"content": {
"ops": [
{
"attributes": { "font": "pacifico" },
"insert": "Happy Birthday!"
}
],
"customProperty": "customValue"
},
"banner": {
"text": "<string>",
"color": "<string>",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
],
"logo": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
}
}
},
"postClaim": { "redirectAfterClaim": "https://example.com/redirect" }
}
} }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customization: {
giftProperties: {
budget: {max: 100, min: 76},
collection: {id: '12345678', featuredProductId: '12345678'},
product: {id: '12345678', displayType: 'displayAsSurprise'},
expiration: {type: 'specificDate', date: '2022-12-06T09:50:38.536Z'},
guaranteedGift: {type: 'specificDate', date: '2022-12-06T09:50:38.536Z'}
},
notificationPolicy: {sendingChannels: ['mail', 'sms'], disableReminders: false},
recipientExperience: {
type: 'enterAddress',
visualElements: {
reveal: {
type: 'snowGlobe',
primaryColor: '#000000',
secondaryColor: '#000000',
mediaItems: {
background: [{type: 'image', url: 'https://example.com/image.jpg'}],
logo: [{type: 'image', url: 'https://example.com/image.jpg'}]
}
},
greeting: {
content: {
ops: [{attributes: {font: 'pacifico'}, insert: 'Happy Birthday!'}],
customProperty: 'customValue'
},
banner: {
text: '<string>',
color: '<string>',
mediaItems: {
background: [{type: 'image', url: 'https://example.com/image.jpg'}],
logo: [{type: 'image', url: 'https://example.com/image.jpg'}]
}
}
}
},
postClaim: {redirectAfterClaim: 'https://example.com/redirect'}
}
}
})
};
fetch('https://api.snappy.com/public-api/v2/gifts/{giftId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.snappy.com/public-api/v2/gifts/{giftId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'customization' => [
'giftProperties' => [
'budget' => [
'max' => 100,
'min' => 76
],
'collection' => [
'id' => '12345678',
'featuredProductId' => '12345678'
],
'product' => [
'id' => '12345678',
'displayType' => 'displayAsSurprise'
],
'expiration' => [
'type' => 'specificDate',
'date' => '2022-12-06T09:50:38.536Z'
],
'guaranteedGift' => [
'type' => 'specificDate',
'date' => '2022-12-06T09:50:38.536Z'
]
],
'notificationPolicy' => [
'sendingChannels' => [
'mail',
'sms'
],
'disableReminders' => false
],
'recipientExperience' => [
'type' => 'enterAddress',
'visualElements' => [
'reveal' => [
'type' => 'snowGlobe',
'primaryColor' => '#000000',
'secondaryColor' => '#000000',
'mediaItems' => [
'background' => [
[
'type' => 'image',
'url' => 'https://example.com/image.jpg'
]
],
'logo' => [
[
'type' => 'image',
'url' => 'https://example.com/image.jpg'
]
]
]
],
'greeting' => [
'content' => [
'ops' => [
[
'attributes' => [
'font' => 'pacifico'
],
'insert' => 'Happy Birthday!'
]
],
'customProperty' => 'customValue'
],
'banner' => [
'text' => '<string>',
'color' => '<string>',
'mediaItems' => [
'background' => [
[
'type' => 'image',
'url' => 'https://example.com/image.jpg'
]
],
'logo' => [
[
'type' => 'image',
'url' => 'https://example.com/image.jpg'
]
]
]
]
]
],
'postClaim' => [
'redirectAfterClaim' => 'https://example.com/redirect'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.snappy.com/public-api/v2/gifts/{giftId}"
payload := strings.NewReader("{\n \"customization\": {\n \"giftProperties\": {\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"collection\": {\n \"id\": \"12345678\",\n \"featuredProductId\": \"12345678\"\n },\n \"product\": {\n \"id\": \"12345678\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"expiration\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n },\n \"guaranteedGift\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\",\n \"sms\"\n ],\n \"disableReminders\": false\n },\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ],\n \"customProperty\": \"customValue\"\n },\n \"banner\": {\n \"text\": \"<string>\",\n \"color\": \"<string>\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n }\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.snappy.com/public-api/v2/gifts/{giftId}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customization\": {\n \"giftProperties\": {\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"collection\": {\n \"id\": \"12345678\",\n \"featuredProductId\": \"12345678\"\n },\n \"product\": {\n \"id\": \"12345678\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"expiration\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n },\n \"guaranteedGift\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\",\n \"sms\"\n ],\n \"disableReminders\": false\n },\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ],\n \"customProperty\": \"customValue\"\n },\n \"banner\": {\n \"text\": \"<string>\",\n \"color\": \"<string>\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n }\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snappy.com/public-api/v2/gifts/{giftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customization\": {\n \"giftProperties\": {\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"collection\": {\n \"id\": \"12345678\",\n \"featuredProductId\": \"12345678\"\n },\n \"product\": {\n \"id\": \"12345678\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"expiration\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n },\n \"guaranteedGift\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\",\n \"sms\"\n ],\n \"disableReminders\": false\n },\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ],\n \"customProperty\": \"customValue\"\n },\n \"banner\": {\n \"text\": \"<string>\",\n \"color\": \"<string>\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n }\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"companyId": "12345678",
"campaignId": "<string>",
"status": "<string>",
"budgetPlan": 123,
"tyn": "<string>",
"estimatedCost": {
"budget": 100,
"estimatedFee": 2,
"estimatedTax": 7,
"estimatedTotalCost": 109
},
"expirationDate": "2022-12-06T09:50:38.536Z",
"createdAt": "<string>",
"link": "<string>",
"success": true,
"deliveryDetails": {
"carrier": "<string>",
"trackingNumber": "<string>",
"trackingLink": "<string>",
"deliveredAt": "2022-12-06T09:50:38.536Z",
"outForDelivery": "2022-12-06T09:50:38.536Z",
"outForDeliveryDate": "2022-12-06T09:50:38.536Z"
},
"finalCost": {
"cost": 100,
"finalFee": 2,
"finalTax": 7,
"totalFinalCost": 109
},
"recipient": {
"firstname": "John",
"lastname": "Doe",
"externalId": "1234567890",
"phone": "+1234567890",
"email": "example@domain.com",
"key": "abc123"
},
"orders": [
{
"id": "<string>",
"orderedProducts": [
{
"selectedProduct": {
"variantId": "<string>",
"title": "<string>"
},
"deliveryDetails": {
"carrier": "<string>",
"trackingNumber": "<string>",
"trackingLink": "<string>",
"deliveryDates": {
"outForDelivery": "2023-11-07T05:31:56Z",
"estimated": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z"
}
}
}
],
"orderRecipient": {
"firstName": "John",
"lastName": "Doe",
"country": "US"
}
}
],
"customization": {
"giftProperties": {
"budget": {
"max": 100,
"min": 76
}
},
"recipientNotifications": {
"sendingChannels": [
"mail",
"sms"
],
"disableReminders": false
},
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000"
},
"greeting": {
"content": {
"ops": [
{
"insert": "Happy Birthday!"
}
]
},
"banner": {
"text": "Happy Birthday!",
"color": "#000000",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
}
},
"postClaim": {
"redirectAfterClaim": "https://example.com/redirect"
}
}
}
}
}{
"status": 400,
"errorCode": "400_PBLC_001",
"message": "Bad Request"
}{
"status": 401,
"errorCode": "401_PBLC_001",
"message": "Unauthorized"
}{
"status": 403,
"errorCode": "403_PBLC_001",
"message": "Forbidden"
}{
"status": 404,
"errorCode": "404_PBLC_001",
"message": "Gift not found"
}{
"status": 409,
"errorCode": "409_PBLC_001",
"message": "Gift already claimed/invoiced"
}Update gift by ID
Use this endpoint to update the Gift Customization settings of a specific gift that has not yet been claimed. Changes apply only to unclaimed gifts.
Required fields:
giftId- the Gift identifier, passed as a path parameter
Optional fields: (in request body, under customization)
giftProperties- budget, expiration, collection / product, guaranteed gift configurationnotificationPolicy- sending channels, reminder settingsrecipientExperience- type, visual elements, post-claim redirect
Optional parameters:
companyIdquery parameter - Company ID (when not inferable from the calling key)
Behavior Notes
- Changes apply only to unclaimed gifts (status
unopened,unwrapped, oropened). Updating a claimed gift returns409(409_PBLC_001). - Returns
404if the Gift doesn’t exist or isn’t accessible to the calling key.
Permissions
- Requires:
gifts:update
curl --request PATCH \
--url https://api.snappy.com/public-api/v2/gifts/{giftId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"customization": {
"giftProperties": {
"budget": {
"max": 100,
"min": 76
},
"collection": {
"id": "12345678",
"featuredProductId": "12345678"
},
"product": {
"id": "12345678",
"displayType": "displayAsSurprise"
},
"expiration": {
"type": "specificDate",
"date": "2022-12-06T09:50:38.536Z"
},
"guaranteedGift": {
"type": "specificDate",
"date": "2022-12-06T09:50:38.536Z"
}
},
"notificationPolicy": {
"sendingChannels": [
"mail",
"sms"
],
"disableReminders": false
},
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
],
"logo": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
},
"greeting": {
"content": {
"ops": [
{
"attributes": {
"font": "pacifico"
},
"insert": "Happy Birthday!"
}
],
"customProperty": "customValue"
},
"banner": {
"text": "<string>",
"color": "<string>",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
],
"logo": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
}
}
},
"postClaim": {
"redirectAfterClaim": "https://example.com/redirect"
}
}
}
}
'import requests
url = "https://api.snappy.com/public-api/v2/gifts/{giftId}"
payload = { "customization": {
"giftProperties": {
"budget": {
"max": 100,
"min": 76
},
"collection": {
"id": "12345678",
"featuredProductId": "12345678"
},
"product": {
"id": "12345678",
"displayType": "displayAsSurprise"
},
"expiration": {
"type": "specificDate",
"date": "2022-12-06T09:50:38.536Z"
},
"guaranteedGift": {
"type": "specificDate",
"date": "2022-12-06T09:50:38.536Z"
}
},
"notificationPolicy": {
"sendingChannels": ["mail", "sms"],
"disableReminders": False
},
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
],
"logo": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
},
"greeting": {
"content": {
"ops": [
{
"attributes": { "font": "pacifico" },
"insert": "Happy Birthday!"
}
],
"customProperty": "customValue"
},
"banner": {
"text": "<string>",
"color": "<string>",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
],
"logo": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
}
}
},
"postClaim": { "redirectAfterClaim": "https://example.com/redirect" }
}
} }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customization: {
giftProperties: {
budget: {max: 100, min: 76},
collection: {id: '12345678', featuredProductId: '12345678'},
product: {id: '12345678', displayType: 'displayAsSurprise'},
expiration: {type: 'specificDate', date: '2022-12-06T09:50:38.536Z'},
guaranteedGift: {type: 'specificDate', date: '2022-12-06T09:50:38.536Z'}
},
notificationPolicy: {sendingChannels: ['mail', 'sms'], disableReminders: false},
recipientExperience: {
type: 'enterAddress',
visualElements: {
reveal: {
type: 'snowGlobe',
primaryColor: '#000000',
secondaryColor: '#000000',
mediaItems: {
background: [{type: 'image', url: 'https://example.com/image.jpg'}],
logo: [{type: 'image', url: 'https://example.com/image.jpg'}]
}
},
greeting: {
content: {
ops: [{attributes: {font: 'pacifico'}, insert: 'Happy Birthday!'}],
customProperty: 'customValue'
},
banner: {
text: '<string>',
color: '<string>',
mediaItems: {
background: [{type: 'image', url: 'https://example.com/image.jpg'}],
logo: [{type: 'image', url: 'https://example.com/image.jpg'}]
}
}
}
},
postClaim: {redirectAfterClaim: 'https://example.com/redirect'}
}
}
})
};
fetch('https://api.snappy.com/public-api/v2/gifts/{giftId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.snappy.com/public-api/v2/gifts/{giftId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'customization' => [
'giftProperties' => [
'budget' => [
'max' => 100,
'min' => 76
],
'collection' => [
'id' => '12345678',
'featuredProductId' => '12345678'
],
'product' => [
'id' => '12345678',
'displayType' => 'displayAsSurprise'
],
'expiration' => [
'type' => 'specificDate',
'date' => '2022-12-06T09:50:38.536Z'
],
'guaranteedGift' => [
'type' => 'specificDate',
'date' => '2022-12-06T09:50:38.536Z'
]
],
'notificationPolicy' => [
'sendingChannels' => [
'mail',
'sms'
],
'disableReminders' => false
],
'recipientExperience' => [
'type' => 'enterAddress',
'visualElements' => [
'reveal' => [
'type' => 'snowGlobe',
'primaryColor' => '#000000',
'secondaryColor' => '#000000',
'mediaItems' => [
'background' => [
[
'type' => 'image',
'url' => 'https://example.com/image.jpg'
]
],
'logo' => [
[
'type' => 'image',
'url' => 'https://example.com/image.jpg'
]
]
]
],
'greeting' => [
'content' => [
'ops' => [
[
'attributes' => [
'font' => 'pacifico'
],
'insert' => 'Happy Birthday!'
]
],
'customProperty' => 'customValue'
],
'banner' => [
'text' => '<string>',
'color' => '<string>',
'mediaItems' => [
'background' => [
[
'type' => 'image',
'url' => 'https://example.com/image.jpg'
]
],
'logo' => [
[
'type' => 'image',
'url' => 'https://example.com/image.jpg'
]
]
]
]
]
],
'postClaim' => [
'redirectAfterClaim' => 'https://example.com/redirect'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.snappy.com/public-api/v2/gifts/{giftId}"
payload := strings.NewReader("{\n \"customization\": {\n \"giftProperties\": {\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"collection\": {\n \"id\": \"12345678\",\n \"featuredProductId\": \"12345678\"\n },\n \"product\": {\n \"id\": \"12345678\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"expiration\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n },\n \"guaranteedGift\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\",\n \"sms\"\n ],\n \"disableReminders\": false\n },\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ],\n \"customProperty\": \"customValue\"\n },\n \"banner\": {\n \"text\": \"<string>\",\n \"color\": \"<string>\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n }\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.snappy.com/public-api/v2/gifts/{giftId}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customization\": {\n \"giftProperties\": {\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"collection\": {\n \"id\": \"12345678\",\n \"featuredProductId\": \"12345678\"\n },\n \"product\": {\n \"id\": \"12345678\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"expiration\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n },\n \"guaranteedGift\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\",\n \"sms\"\n ],\n \"disableReminders\": false\n },\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ],\n \"customProperty\": \"customValue\"\n },\n \"banner\": {\n \"text\": \"<string>\",\n \"color\": \"<string>\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n }\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snappy.com/public-api/v2/gifts/{giftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customization\": {\n \"giftProperties\": {\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"collection\": {\n \"id\": \"12345678\",\n \"featuredProductId\": \"12345678\"\n },\n \"product\": {\n \"id\": \"12345678\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"expiration\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n },\n \"guaranteedGift\": {\n \"type\": \"specificDate\",\n \"date\": \"2022-12-06T09:50:38.536Z\"\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\",\n \"sms\"\n ],\n \"disableReminders\": false\n },\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ],\n \"customProperty\": \"customValue\"\n },\n \"banner\": {\n \"text\": \"<string>\",\n \"color\": \"<string>\",\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ],\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/image.jpg\"\n }\n ]\n }\n }\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"companyId": "12345678",
"campaignId": "<string>",
"status": "<string>",
"budgetPlan": 123,
"tyn": "<string>",
"estimatedCost": {
"budget": 100,
"estimatedFee": 2,
"estimatedTax": 7,
"estimatedTotalCost": 109
},
"expirationDate": "2022-12-06T09:50:38.536Z",
"createdAt": "<string>",
"link": "<string>",
"success": true,
"deliveryDetails": {
"carrier": "<string>",
"trackingNumber": "<string>",
"trackingLink": "<string>",
"deliveredAt": "2022-12-06T09:50:38.536Z",
"outForDelivery": "2022-12-06T09:50:38.536Z",
"outForDeliveryDate": "2022-12-06T09:50:38.536Z"
},
"finalCost": {
"cost": 100,
"finalFee": 2,
"finalTax": 7,
"totalFinalCost": 109
},
"recipient": {
"firstname": "John",
"lastname": "Doe",
"externalId": "1234567890",
"phone": "+1234567890",
"email": "example@domain.com",
"key": "abc123"
},
"orders": [
{
"id": "<string>",
"orderedProducts": [
{
"selectedProduct": {
"variantId": "<string>",
"title": "<string>"
},
"deliveryDetails": {
"carrier": "<string>",
"trackingNumber": "<string>",
"trackingLink": "<string>",
"deliveryDates": {
"outForDelivery": "2023-11-07T05:31:56Z",
"estimated": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z"
}
}
}
],
"orderRecipient": {
"firstName": "John",
"lastName": "Doe",
"country": "US"
}
}
],
"customization": {
"giftProperties": {
"budget": {
"max": 100,
"min": 76
}
},
"recipientNotifications": {
"sendingChannels": [
"mail",
"sms"
],
"disableReminders": false
},
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000"
},
"greeting": {
"content": {
"ops": [
{
"insert": "Happy Birthday!"
}
]
},
"banner": {
"text": "Happy Birthday!",
"color": "#000000",
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/image.jpg"
}
]
}
}
},
"postClaim": {
"redirectAfterClaim": "https://example.com/redirect"
}
}
}
}
}{
"status": 400,
"errorCode": "400_PBLC_001",
"message": "Bad Request"
}{
"status": 401,
"errorCode": "401_PBLC_001",
"message": "Unauthorized"
}{
"status": 403,
"errorCode": "403_PBLC_001",
"message": "Forbidden"
}{
"status": 404,
"errorCode": "404_PBLC_001",
"message": "Gift not found"
}{
"status": 409,
"errorCode": "409_PBLC_001",
"message": "Gift already claimed/invoiced"
}Authorizations
Company Level Authentication
Company level authentication provides access to all resources under your company, including accounts, campaigns, gifts, and recipients.
Getting Your API Key
- Create an API Key: Use the
POST /v2/authentication/apiKeysendpoint to generate a new API key - Set Expiration: Choose from 30, 60, 90, or 180 days (default: 90 days)
- Optional mTLS: Enable mutual TLS for enhanced security
- Name Your Key: Provide a descriptive name for easy identification
Using Your API Key
Include your API key in the X-Api-Key header for every request:
X-Api-Key: YOUR_24_CHARACTER_API_KEY
API Key Management
- Maximum Keys: Up to 3 active API keys per company
- Rotation: Delete old keys before creating new ones when at the limit
- Security: Keys are hashed and cannot be retrieved after creation
Enhanced Security (mTLS)
For production environments, enable mutual TLS authentication:
- Set
enforceMtls: truewhen creating the API key - Contact support to obtain your client certificates
- Use the mTLS endpoint:
https://mtls-api.snappy.com/public-api
Path Parameters
Gift ID
^[A-Za-z0-9]{8,}$"abc123de"
Query Parameters
Company ID
^[A-Za-z0-9]{8,}$"12345678"
Body
Gift configuration to patch
Show child attributes
Show child attributes
Response
Ok
The Gift object.
The gift identifier
The company id
"12345678"
The campaign identifier
The status of the gift.
The budget plan of the gift. This field is deprecated, use "customization.giftProperties.budget" instead.
A Thank You Note sent by the end client.
The estimated cost of the gift including estimated tax and fee.
Show child attributes
Show child attributes
{
"budget": 100,
"estimatedFee": 2,
"estimatedTax": 7,
"estimatedTotalCost": 109
}
When the gift will be expired. Date Format: YYYY-MM-DDThh:mm:ss.sZ. This field is deprecated, use "customization.giftProperties.expiration" instead.
"2022-12-06T09:50:38.536Z"
When the gift was originally created. Date Format: YYYY-MM-DDThh:mm:ss.sZ. e.g. 2022-12-06T09:50:38.536Z
The link used to redeem the gift.
The success of the gift creation
The Delivery Details object.
Show child attributes
Show child attributes
The final cost of the gift including tax and fee.
Show child attributes
Show child attributes
{
"cost": 100,
"finalFee": 2,
"finalTax": 7,
"totalFinalCost": 109
}
The gift recipient object.
Show child attributes
Show child attributes
{
"firstname": "John",
"lastname": "Doe",
"externalId": "1234567890",
"phone": "+1234567890",
"email": "example@domain.com",
"key": "abc123"
}
Show child attributes
Show child attributes
Complete gift customization configuration
Show child attributes
Show child attributes
Was this page helpful?