Give a gift card
curl --request POST \
--url https://api.1club.ai/v1/platform/gift-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1.01,
"reason": "<string>",
"contactId": 123,
"recipientName": "<string>",
"recipientEmail": "jsmith@example.com",
"message": "<string>",
"validityMonths": 60,
"productId": 123
}
'import requests
url = "https://api.1club.ai/v1/platform/gift-cards"
payload = {
"amount": 1.01,
"reason": "<string>",
"contactId": 123,
"recipientName": "<string>",
"recipientEmail": "jsmith@example.com",
"message": "<string>",
"validityMonths": 60,
"productId": 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({
amount: 1.01,
reason: '<string>',
contactId: 123,
recipientName: '<string>',
recipientEmail: 'jsmith@example.com',
message: '<string>',
validityMonths: 60,
productId: 123
})
};
fetch('https://api.1club.ai/v1/platform/gift-cards', 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",
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([
'amount' => 1.01,
'reason' => '<string>',
'contactId' => 123,
'recipientName' => '<string>',
'recipientEmail' => 'jsmith@example.com',
'message' => '<string>',
'validityMonths' => 60,
'productId' => 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"
payload := strings.NewReader("{\n \"amount\": 1.01,\n \"reason\": \"<string>\",\n \"contactId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"message\": \"<string>\",\n \"validityMonths\": 60,\n \"productId\": 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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1.01,\n \"reason\": \"<string>\",\n \"contactId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"message\": \"<string>\",\n \"validityMonths\": 60,\n \"productId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/gift-cards")
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 \"amount\": 1.01,\n \"reason\": \"<string>\",\n \"contactId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"message\": \"<string>\",\n \"validityMonths\": 60,\n \"productId\": 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
Give a gift card
Gives a gift card away, with no sale: a reward, a prize, goodwill after a complaint. It is never revenue. The member (contactId) is emailed the card, and recipientEmail too when given; the code is never returned. reason is recorded for the club’s own records and never shown on the card; message is printed on it. It lasts validityMonths (36 by default; null never expires). Supports the Idempotency-Key header.
POST
/
v1
/
platform
/
gift-cards
Give a gift card
curl --request POST \
--url https://api.1club.ai/v1/platform/gift-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1.01,
"reason": "<string>",
"contactId": 123,
"recipientName": "<string>",
"recipientEmail": "jsmith@example.com",
"message": "<string>",
"validityMonths": 60,
"productId": 123
}
'import requests
url = "https://api.1club.ai/v1/platform/gift-cards"
payload = {
"amount": 1.01,
"reason": "<string>",
"contactId": 123,
"recipientName": "<string>",
"recipientEmail": "jsmith@example.com",
"message": "<string>",
"validityMonths": 60,
"productId": 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({
amount: 1.01,
reason: '<string>',
contactId: 123,
recipientName: '<string>',
recipientEmail: 'jsmith@example.com',
message: '<string>',
validityMonths: 60,
productId: 123
})
};
fetch('https://api.1club.ai/v1/platform/gift-cards', 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",
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([
'amount' => 1.01,
'reason' => '<string>',
'contactId' => 123,
'recipientName' => '<string>',
'recipientEmail' => 'jsmith@example.com',
'message' => '<string>',
'validityMonths' => 60,
'productId' => 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"
payload := strings.NewReader("{\n \"amount\": 1.01,\n \"reason\": \"<string>\",\n \"contactId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"message\": \"<string>\",\n \"validityMonths\": 60,\n \"productId\": 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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1.01,\n \"reason\": \"<string>\",\n \"contactId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"message\": \"<string>\",\n \"validityMonths\": 60,\n \"productId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/gift-cards")
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 \"amount\": 1.01,\n \"reason\": \"<string>\",\n \"contactId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"message\": \"<string>\",\n \"validityMonths\": 60,\n \"productId\": 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
Headers
Body
application/json
Response
Gift card given
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?