curl --request POST \
--url https://api.decodahealth.com/billing/gift-cards/issue \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"amount": 123,
"patientId": "<string>",
"locationId": "<string>",
"recipientPatientId": "<string>",
"recipientNote": "<string>",
"scheduledSendDate": "2023-11-07T05:31:56Z",
"suppressRecipientNotification": false,
"code": "<string>",
"paymentMedium": "VIRTUAL_TERMINAL"
}
'import requests
url = "https://api.decodahealth.com/billing/gift-cards/issue"
payload = {
"amount": 123,
"patientId": "<string>",
"locationId": "<string>",
"recipientPatientId": "<string>",
"recipientNote": "<string>",
"scheduledSendDate": "2023-11-07T05:31:56Z",
"suppressRecipientNotification": False,
"code": "<string>",
"paymentMedium": "VIRTUAL_TERMINAL"
}
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
patientId: '<string>',
locationId: '<string>',
recipientPatientId: '<string>',
recipientNote: '<string>',
scheduledSendDate: '2023-11-07T05:31:56Z',
suppressRecipientNotification: false,
code: '<string>',
paymentMedium: 'VIRTUAL_TERMINAL'
})
};
fetch('https://api.decodahealth.com/billing/gift-cards/issue', 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.decodahealth.com/billing/gift-cards/issue",
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' => 123,
'patientId' => '<string>',
'locationId' => '<string>',
'recipientPatientId' => '<string>',
'recipientNote' => '<string>',
'scheduledSendDate' => '2023-11-07T05:31:56Z',
'suppressRecipientNotification' => false,
'code' => '<string>',
'paymentMedium' => 'VIRTUAL_TERMINAL'
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: application/json",
"TENANT: <tenant>"
],
]);
$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.decodahealth.com/billing/gift-cards/issue"
payload := strings.NewReader("{\n \"amount\": 123,\n \"patientId\": \"<string>\",\n \"locationId\": \"<string>\",\n \"recipientPatientId\": \"<string>\",\n \"recipientNote\": \"<string>\",\n \"scheduledSendDate\": \"2023-11-07T05:31:56Z\",\n \"suppressRecipientNotification\": false,\n \"code\": \"<string>\",\n \"paymentMedium\": \"VIRTUAL_TERMINAL\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TENANT", "<tenant>")
req.Header.Add("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.post("https://api.decodahealth.com/billing/gift-cards/issue")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"patientId\": \"<string>\",\n \"locationId\": \"<string>\",\n \"recipientPatientId\": \"<string>\",\n \"recipientNote\": \"<string>\",\n \"scheduledSendDate\": \"2023-11-07T05:31:56Z\",\n \"suppressRecipientNotification\": false,\n \"code\": \"<string>\",\n \"paymentMedium\": \"VIRTUAL_TERMINAL\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/billing/gift-cards/issue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"patientId\": \"<string>\",\n \"locationId\": \"<string>\",\n \"recipientPatientId\": \"<string>\",\n \"recipientNote\": \"<string>\",\n \"scheduledSendDate\": \"2023-11-07T05:31:56Z\",\n \"suppressRecipientNotification\": false,\n \"code\": \"<string>\",\n \"paymentMedium\": \"VIRTUAL_TERMINAL\"\n}"
response = http.request(request)
puts response.read_body{
"sessionKey": "<string>",
"payinConfigId": "<string>",
"sandbox": true,
"paymentMethods": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Issue Gift Card
Begin a random-amount gift card issuance.
Persists the Charge and pending IssuedGiftCard synchronously (so the
row shows up in the issued list immediately with status=PENDING) and
returns the Rainforest payin config the client uses to embed the payment
terminal. The payin.processing webhook then activates the card.
curl --request POST \
--url https://api.decodahealth.com/billing/gift-cards/issue \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"amount": 123,
"patientId": "<string>",
"locationId": "<string>",
"recipientPatientId": "<string>",
"recipientNote": "<string>",
"scheduledSendDate": "2023-11-07T05:31:56Z",
"suppressRecipientNotification": false,
"code": "<string>",
"paymentMedium": "VIRTUAL_TERMINAL"
}
'import requests
url = "https://api.decodahealth.com/billing/gift-cards/issue"
payload = {
"amount": 123,
"patientId": "<string>",
"locationId": "<string>",
"recipientPatientId": "<string>",
"recipientNote": "<string>",
"scheduledSendDate": "2023-11-07T05:31:56Z",
"suppressRecipientNotification": False,
"code": "<string>",
"paymentMedium": "VIRTUAL_TERMINAL"
}
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
patientId: '<string>',
locationId: '<string>',
recipientPatientId: '<string>',
recipientNote: '<string>',
scheduledSendDate: '2023-11-07T05:31:56Z',
suppressRecipientNotification: false,
code: '<string>',
paymentMedium: 'VIRTUAL_TERMINAL'
})
};
fetch('https://api.decodahealth.com/billing/gift-cards/issue', 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.decodahealth.com/billing/gift-cards/issue",
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' => 123,
'patientId' => '<string>',
'locationId' => '<string>',
'recipientPatientId' => '<string>',
'recipientNote' => '<string>',
'scheduledSendDate' => '2023-11-07T05:31:56Z',
'suppressRecipientNotification' => false,
'code' => '<string>',
'paymentMedium' => 'VIRTUAL_TERMINAL'
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: application/json",
"TENANT: <tenant>"
],
]);
$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.decodahealth.com/billing/gift-cards/issue"
payload := strings.NewReader("{\n \"amount\": 123,\n \"patientId\": \"<string>\",\n \"locationId\": \"<string>\",\n \"recipientPatientId\": \"<string>\",\n \"recipientNote\": \"<string>\",\n \"scheduledSendDate\": \"2023-11-07T05:31:56Z\",\n \"suppressRecipientNotification\": false,\n \"code\": \"<string>\",\n \"paymentMedium\": \"VIRTUAL_TERMINAL\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TENANT", "<tenant>")
req.Header.Add("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.post("https://api.decodahealth.com/billing/gift-cards/issue")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"patientId\": \"<string>\",\n \"locationId\": \"<string>\",\n \"recipientPatientId\": \"<string>\",\n \"recipientNote\": \"<string>\",\n \"scheduledSendDate\": \"2023-11-07T05:31:56Z\",\n \"suppressRecipientNotification\": false,\n \"code\": \"<string>\",\n \"paymentMedium\": \"VIRTUAL_TERMINAL\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/billing/gift-cards/issue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"patientId\": \"<string>\",\n \"locationId\": \"<string>\",\n \"recipientPatientId\": \"<string>\",\n \"recipientNote\": \"<string>\",\n \"scheduledSendDate\": \"2023-11-07T05:31:56Z\",\n \"suppressRecipientNotification\": false,\n \"code\": \"<string>\",\n \"paymentMedium\": \"VIRTUAL_TERMINAL\"\n}"
response = http.request(request)
puts response.read_body{
"sessionKey": "<string>",
"payinConfigId": "<string>",
"sandbox": true,
"paymentMethods": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
The tenant you are making this request on behalf of
Your api key
Body
Staff-initiated, random-amount gift card issuance from /settings/gift-cards.
Runs through the regular checkout pipeline: a synthetic archived GiftCardItem carries the requested denomination, the Charge and pending IssuedGiftCard are persisted synchronously so the row appears in the issued list immediately, and the rainforest webhook activates the card once the payin lands.
Gift card value in cents.
Purchasing patient. Required because the charge pipeline is patient-scoped.
Required when the tenant has the LOCATIONS module enabled.
Recipient patient. When omitted, the card belongs to the purchaser.
Personal message from the sender included in the recipient notification.
When set, the recipient notification is deferred until this time instead of sending immediately on activation.
When True, the gift-card code is not automatically sent to either the recipient or purchaser; staff can still send it manually later.
Optional provider-entered code. Trimmed and stored uppercase when supplied.
How staff collected payment. The issuance modal renders a keyed card entry (VIRTUAL_TERMINAL); an in-person reader would send POS.
POS, VIRTUAL_TERMINAL, PAYMENT_LINK, PAYMENT_PLAN, SUBSCRIPTION, SAVED_PAYMENT_METHOD, MEMBERSHIP, EMBEDDED_TERMINAL, CASH, CHECK, CARE_CREDIT, PATIENT_CREDIT, GIFT_CARD, LOYALTY_POINTS 
