Sell a gift card
curl --request POST \
--url https://api.1club.ai/v1/platform/gift-cards/sell \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contactId": 123,
"amount": 1.01,
"paymentMethodDefinitionId": 123,
"productId": 123,
"price": 1.01,
"reason": "<string>",
"quantity": 1,
"clubId": 123,
"recipientName": "<string>",
"recipientEmail": "jsmith@example.com",
"senderName": "<string>",
"message": "<string>",
"sendAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.1club.ai/v1/platform/gift-cards/sell"
payload = {
"contactId": 123,
"amount": 1.01,
"paymentMethodDefinitionId": 123,
"productId": 123,
"price": 1.01,
"reason": "<string>",
"quantity": 1,
"clubId": 123,
"recipientName": "<string>",
"recipientEmail": "jsmith@example.com",
"senderName": "<string>",
"message": "<string>",
"sendAt": "2023-11-07T05:31:56Z"
}
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({
contactId: 123,
amount: 1.01,
paymentMethodDefinitionId: 123,
productId: 123,
price: 1.01,
reason: '<string>',
quantity: 1,
clubId: 123,
recipientName: '<string>',
recipientEmail: 'jsmith@example.com',
senderName: '<string>',
message: '<string>',
sendAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.1club.ai/v1/platform/gift-cards/sell', 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/sell",
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([
'contactId' => 123,
'amount' => 1.01,
'paymentMethodDefinitionId' => 123,
'productId' => 123,
'price' => 1.01,
'reason' => '<string>',
'quantity' => 1,
'clubId' => 123,
'recipientName' => '<string>',
'recipientEmail' => 'jsmith@example.com',
'senderName' => '<string>',
'message' => '<string>',
'sendAt' => '2023-11-07T05:31:56Z'
]),
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/sell"
payload := strings.NewReader("{\n \"contactId\": 123,\n \"amount\": 1.01,\n \"paymentMethodDefinitionId\": 123,\n \"productId\": 123,\n \"price\": 1.01,\n \"reason\": \"<string>\",\n \"quantity\": 1,\n \"clubId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"message\": \"<string>\",\n \"sendAt\": \"2023-11-07T05:31:56Z\"\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/sell")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contactId\": 123,\n \"amount\": 1.01,\n \"paymentMethodDefinitionId\": 123,\n \"productId\": 123,\n \"price\": 1.01,\n \"reason\": \"<string>\",\n \"quantity\": 1,\n \"clubId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"message\": \"<string>\",\n \"sendAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/gift-cards/sell")
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 \"contactId\": 123,\n \"amount\": 1.01,\n \"paymentMethodDefinitionId\": 123,\n \"productId\": 123,\n \"price\": 1.01,\n \"reason\": \"<string>\",\n \"quantity\": 1,\n \"clubId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"message\": \"<string>\",\n \"sendAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": 123,
"total": 123,
"giftCards": [
{
"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
Sell a gift card
Sells a member gift cards and records how they paid: an order with the gift card line, executed, then paid in full with a manual payment method (cash, a terminal, a bank transfer). The cards are issued once paid and emailed to the member (and to recipientEmail, on sendAt when given); their codes are never returned. A price below amount sells each card for less than it holds and needs a reason. Without productId, the organization’s only gift card is sold. Supports the Idempotency-Key header.
POST
/
v1
/
platform
/
gift-cards
/
sell
Sell a gift card
curl --request POST \
--url https://api.1club.ai/v1/platform/gift-cards/sell \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contactId": 123,
"amount": 1.01,
"paymentMethodDefinitionId": 123,
"productId": 123,
"price": 1.01,
"reason": "<string>",
"quantity": 1,
"clubId": 123,
"recipientName": "<string>",
"recipientEmail": "jsmith@example.com",
"senderName": "<string>",
"message": "<string>",
"sendAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.1club.ai/v1/platform/gift-cards/sell"
payload = {
"contactId": 123,
"amount": 1.01,
"paymentMethodDefinitionId": 123,
"productId": 123,
"price": 1.01,
"reason": "<string>",
"quantity": 1,
"clubId": 123,
"recipientName": "<string>",
"recipientEmail": "jsmith@example.com",
"senderName": "<string>",
"message": "<string>",
"sendAt": "2023-11-07T05:31:56Z"
}
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({
contactId: 123,
amount: 1.01,
paymentMethodDefinitionId: 123,
productId: 123,
price: 1.01,
reason: '<string>',
quantity: 1,
clubId: 123,
recipientName: '<string>',
recipientEmail: 'jsmith@example.com',
senderName: '<string>',
message: '<string>',
sendAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.1club.ai/v1/platform/gift-cards/sell', 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/sell",
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([
'contactId' => 123,
'amount' => 1.01,
'paymentMethodDefinitionId' => 123,
'productId' => 123,
'price' => 1.01,
'reason' => '<string>',
'quantity' => 1,
'clubId' => 123,
'recipientName' => '<string>',
'recipientEmail' => 'jsmith@example.com',
'senderName' => '<string>',
'message' => '<string>',
'sendAt' => '2023-11-07T05:31:56Z'
]),
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/sell"
payload := strings.NewReader("{\n \"contactId\": 123,\n \"amount\": 1.01,\n \"paymentMethodDefinitionId\": 123,\n \"productId\": 123,\n \"price\": 1.01,\n \"reason\": \"<string>\",\n \"quantity\": 1,\n \"clubId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"message\": \"<string>\",\n \"sendAt\": \"2023-11-07T05:31:56Z\"\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/sell")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contactId\": 123,\n \"amount\": 1.01,\n \"paymentMethodDefinitionId\": 123,\n \"productId\": 123,\n \"price\": 1.01,\n \"reason\": \"<string>\",\n \"quantity\": 1,\n \"clubId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"message\": \"<string>\",\n \"sendAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/gift-cards/sell")
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 \"contactId\": 123,\n \"amount\": 1.01,\n \"paymentMethodDefinitionId\": 123,\n \"productId\": 123,\n \"price\": 1.01,\n \"reason\": \"<string>\",\n \"quantity\": 1,\n \"clubId\": 123,\n \"recipientName\": \"<string>\",\n \"recipientEmail\": \"jsmith@example.com\",\n \"senderName\": \"<string>\",\n \"message\": \"<string>\",\n \"sendAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": 123,
"total": 123,
"giftCards": [
{
"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
Was this page helpful?