curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
"{ \"gift_card\": { \"pin\": \"IAAKEBJYMEXF6T3Q\" }, \"account\": { \"id\": \"cust_1234\" } }"
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions"
payload = "{ \"gift_card\": { \"pin\": \"IAAKEBJYMEXF6T3Q\" }, \"account\": { \"id\": \"cust_1234\" } }"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify('{ "gift_card": { "pin": "IAAKEBJYMEXF6T3Q" }, "account": { "id": "cust_1234" } }')
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions', 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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('{ "gift_card": { "pin": "IAAKEBJYMEXF6T3Q" }, "account": { "id": "cust_1234" } }'),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions"
payload := strings.NewReader("\"{ \\\"gift_card\\\": { \\\"pin\\\": \\\"IAAKEBJYMEXF6T3Q\\\" }, \\\"account\\\": { \\\"id\\\": \\\"cust_1234\\\" } }\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("\"{ \\\"gift_card\\\": { \\\"pin\\\": \\\"IAAKEBJYMEXF6T3Q\\\" }, \\\"account\\\": { \\\"id\\\": \\\"cust_1234\\\" } }\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "\"{ \\\"gift_card\\\": { \\\"pin\\\": \\\"IAAKEBJYMEXF6T3Q\\\" }, \\\"account\\\": { \\\"id\\\": \\\"cust_1234\\\" } }\""
response = http.request(request)
puts response.read_body"{ \"object\": \"GiftCardRedemption\", \"vid\": \"4375c41aeaaae6dac40d629313fed2c3cb820fbf\", \"gift_card\": { \"object\": \"GiftCard\", \"vid\": \"8d1ece91e44441c3d424717c561dc8df74c4b5e4\", \"last_digits\": \"9FSE\", \"pin_length\": 16, \"hash_type\": \"sha1\", \"pin_hash\": \"b535aae49e30398c710989a79d56306e9ec0f309\", \"payment_provider\": \"Topps\", \"status\": \"Redeemed\", \"amount\": 500, \"currency\": \"MXN\", \"product_number\": \"91422282643651081111\" }, \"account\": { \"object\": \"Account\", \"id\": \"cust_1234\", \"vid\": \"f147870b2c86a00fb1264fb64c0a8b58fcd95b4d\", \"created\": \"2021-03-09T14:35:02-08:00\", \"email\": \"cbrown@example.com\", \"email_type\": \"html\", \"company\": \"Peanuts\", \"name\": \"Charlie Brown\", \"shipping_address\": { \"object\": \"Address\", \"vid\": \"dad524f59d1bd72f10a9162b7d7790caa39678dc\", \"name\": \"Charlie Brown\", \"line1\": \"123 Main Street\", \"city\": \"San Francisco\", \"district\": \"CA\", \"postal_code\": \"94105\", \"country\": \"US\", \"phone\": \"415-555-3212\" }, \"credit\": { \"object\": \"Credit\", \"currency_amounts\": { \"object\": \"List\", \"data\": [ { \"object\": \"CurrencyAmount\", \"vid\": \"4056f2a40c447475fbcc351aa24f9869d64832e4\", \"currency\": \"MXN\", \"amount\": 500, \"description\": \"\", \"reason\": \"Topps GiftCard Redemption\", \"granted_by_cashbox\": false, \"granted\": \"2021-03-25T18:39:06-07:00\", \"source\": \"Account\" } ], \"total_count\": 1 } } } }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Create a Gift Card Redemption
Creates a new Gift Card redemption object in Subscribe. It also creates its associated objects such as a gift card object and the account’s credit object. The customer’s account must exist in the system prior to redemption.
Note:- An existing gift card in the system that have not yet been redeemed can use this call for redemption.
curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
"{ \"gift_card\": { \"pin\": \"IAAKEBJYMEXF6T3Q\" }, \"account\": { \"id\": \"cust_1234\" } }"
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions"
payload = "{ \"gift_card\": { \"pin\": \"IAAKEBJYMEXF6T3Q\" }, \"account\": { \"id\": \"cust_1234\" } }"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify('{ "gift_card": { "pin": "IAAKEBJYMEXF6T3Q" }, "account": { "id": "cust_1234" } }')
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions', 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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('{ "gift_card": { "pin": "IAAKEBJYMEXF6T3Q" }, "account": { "id": "cust_1234" } }'),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions"
payload := strings.NewReader("\"{ \\\"gift_card\\\": { \\\"pin\\\": \\\"IAAKEBJYMEXF6T3Q\\\" }, \\\"account\\\": { \\\"id\\\": \\\"cust_1234\\\" } }\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("\"{ \\\"gift_card\\\": { \\\"pin\\\": \\\"IAAKEBJYMEXF6T3Q\\\" }, \\\"account\\\": { \\\"id\\\": \\\"cust_1234\\\" } }\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/gift_card_redemptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "\"{ \\\"gift_card\\\": { \\\"pin\\\": \\\"IAAKEBJYMEXF6T3Q\\\" }, \\\"account\\\": { \\\"id\\\": \\\"cust_1234\\\" } }\""
response = http.request(request)
puts response.read_body"{ \"object\": \"GiftCardRedemption\", \"vid\": \"4375c41aeaaae6dac40d629313fed2c3cb820fbf\", \"gift_card\": { \"object\": \"GiftCard\", \"vid\": \"8d1ece91e44441c3d424717c561dc8df74c4b5e4\", \"last_digits\": \"9FSE\", \"pin_length\": 16, \"hash_type\": \"sha1\", \"pin_hash\": \"b535aae49e30398c710989a79d56306e9ec0f309\", \"payment_provider\": \"Topps\", \"status\": \"Redeemed\", \"amount\": 500, \"currency\": \"MXN\", \"product_number\": \"91422282643651081111\" }, \"account\": { \"object\": \"Account\", \"id\": \"cust_1234\", \"vid\": \"f147870b2c86a00fb1264fb64c0a8b58fcd95b4d\", \"created\": \"2021-03-09T14:35:02-08:00\", \"email\": \"cbrown@example.com\", \"email_type\": \"html\", \"company\": \"Peanuts\", \"name\": \"Charlie Brown\", \"shipping_address\": { \"object\": \"Address\", \"vid\": \"dad524f59d1bd72f10a9162b7d7790caa39678dc\", \"name\": \"Charlie Brown\", \"line1\": \"123 Main Street\", \"city\": \"San Francisco\", \"district\": \"CA\", \"postal_code\": \"94105\", \"country\": \"US\", \"phone\": \"415-555-3212\" }, \"credit\": { \"object\": \"Credit\", \"currency_amounts\": { \"object\": \"List\", \"data\": [ { \"object\": \"CurrencyAmount\", \"vid\": \"4056f2a40c447475fbcc351aa24f9869d64832e4\", \"currency\": \"MXN\", \"amount\": 500, \"description\": \"\", \"reason\": \"Topps GiftCard Redemption\", \"granted_by_cashbox\": false, \"granted\": \"2021-03-25T18:39:06-07:00\", \"source\": \"Account\" } ], \"total_count\": 1 } } } }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
JSON - Gift Card Redemption gift card pin and Account id or vid are required. The gift card's pin number is hidden number on the card itself that must be revealed for redemption. It is used to uniquely identify the gift card with the payment provider.
Value is "GiftCardRedemption"
GiftCardRedemption A unique identifier. Optionally, this object can also be identified by its vid. Using a unique custom identifier is strongly encouraged.
128A Globally Unique Identifier (GUID) for this object. This value is generated by Vindicia.
128The date/time the object was created.
Show child attributes
Show child attributes
The Account represents a merchant’s customer. As such it can contain as much or as little information as you collect about the customers (people or organizations) to which you offer billing and subscriptions. Subscriptions and Transactions must belong to an Account - as such, Accounts will be required in CashBox for billing. Read More in our User Guide
An Account can have any number of children accounts and may have up to one parent account. Read more in our User Guide.
An Account owns the “on file” payment methods to be used by it in billing.
Show child attributes
Show child attributes
The date/time the object was created.
Response
JSON A full GiftCardRedemption object..
Value is "GiftCardRedemption"
GiftCardRedemption A unique identifier. Optionally, this object can also be identified by its vid. Using a unique custom identifier is strongly encouraged.
128A Globally Unique Identifier (GUID) for this object. This value is generated by Vindicia.
128The date/time the object was created.
Show child attributes
Show child attributes
The Account represents a merchant’s customer. As such it can contain as much or as little information as you collect about the customers (people or organizations) to which you offer billing and subscriptions. Subscriptions and Transactions must belong to an Account - as such, Accounts will be required in CashBox for billing. Read More in our User Guide
An Account can have any number of children accounts and may have up to one parent account. Read more in our User Guide.
An Account owns the “on file” payment methods to be used by it in billing.
Show child attributes
Show child attributes
The date/time the object was created.

