Redeem a gift card
curl --request POST \
--url https://api.1club.ai/v1/platform/gift-cards/redeem \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"contactId": 123
}
'import requests
url = "https://api.1club.ai/v1/platform/gift-cards/redeem"
payload = {
"code": "<string>",
"contactId": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', contactId: 123})
};
fetch('https://api.1club.ai/v1/platform/gift-cards/redeem', 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.1club.ai/v1/platform/gift-cards/redeem",
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([
'code' => '<string>',
'contactId' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.1club.ai/v1/platform/gift-cards/redeem"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"contactId\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.1club.ai/v1/platform/gift-cards/redeem")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\",\n \"contactId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/gift-cards/redeem")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\",\n \"contactId\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": 123,
"code": "<string>",
"name": "<string>",
"amount": 123,
"remaining": 123,
"currency": "<string>",
"status": "scheduled",
"source": "sale",
"channel": "admin",
"buyer": {
"id": 123,
"name": "<string>",
"email": "<string>"
},
"recipientName": "<string>",
"recipientEmail": "<string>",
"message": "<string>",
"soldAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"redeemedAt": "2023-11-07T05:31:56Z",
"redeemedBy": {
"id": 123,
"name": "<string>",
"email": "<string>"
},
"issuedBy": {
"id": 123,
"name": "<string>"
},
"soldBy": {
"id": 123,
"name": "<string>"
},
"issueReason": "<string>",
"voidedAt": "2023-11-07T05:31:56Z",
"voidReason": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Gift cards
Redeem a gift card
Adds a gift card’s whole value to a member’s wallet, by its code. Each code works once. A refused code answers GIFT_CARD_NOT_REDEEMABLE with the reason in details.reason: not_found, redeemed, expired, void or currency_mismatch.
POST
/
v1
/
platform
/
gift-cards
/
redeem
Redeem a gift card
curl --request POST \
--url https://api.1club.ai/v1/platform/gift-cards/redeem \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"contactId": 123
}
'import requests
url = "https://api.1club.ai/v1/platform/gift-cards/redeem"
payload = {
"code": "<string>",
"contactId": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', contactId: 123})
};
fetch('https://api.1club.ai/v1/platform/gift-cards/redeem', 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.1club.ai/v1/platform/gift-cards/redeem",
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([
'code' => '<string>',
'contactId' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.1club.ai/v1/platform/gift-cards/redeem"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"contactId\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.1club.ai/v1/platform/gift-cards/redeem")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\",\n \"contactId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/gift-cards/redeem")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\",\n \"contactId\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": 123,
"code": "<string>",
"name": "<string>",
"amount": 123,
"remaining": 123,
"currency": "<string>",
"status": "scheduled",
"source": "sale",
"channel": "admin",
"buyer": {
"id": 123,
"name": "<string>",
"email": "<string>"
},
"recipientName": "<string>",
"recipientEmail": "<string>",
"message": "<string>",
"soldAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"redeemedAt": "2023-11-07T05:31:56Z",
"redeemedBy": {
"id": 123,
"name": "<string>",
"email": "<string>"
},
"issuedBy": {
"id": 123,
"name": "<string>"
},
"soldBy": {
"id": 123,
"name": "<string>"
},
"issueReason": "<string>",
"voidedAt": "2023-11-07T05:31:56Z",
"voidReason": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Body
application/json
Response
The card, now in the member's wallet
A Gift Card: money identified by a code, redeemed whole into the member’s Wallet. Its code is never returned in full: the code is the money.
Was this page helpful?