curl --request POST \
--url https://api.vori.com/v1/gift-cards/{id}/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "199.99",
"idempotency_key": "<string>",
"description": "<string>",
"employee_id": "<string>",
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_id": "<string>"
}
'import requests
url = "https://api.vori.com/v1/gift-cards/{id}/transactions"
payload = {
"amount": "199.99",
"idempotency_key": "<string>",
"description": "<string>",
"employee_id": "<string>",
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_id": "<string>"
}
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: '199.99',
idempotency_key: '<string>',
description: '<string>',
employee_id: '<string>',
order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
store_id: '<string>'
})
};
fetch('https://api.vori.com/v1/gift-cards/{id}/transactions', 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.vori.com/v1/gift-cards/{id}/transactions",
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' => '199.99',
'idempotency_key' => '<string>',
'description' => '<string>',
'employee_id' => '<string>',
'order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'store_id' => '<string>'
]),
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.vori.com/v1/gift-cards/{id}/transactions"
payload := strings.NewReader("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"store_id\": \"<string>\"\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.vori.com/v1/gift-cards/{id}/transactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"store_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/gift-cards/{id}/transactions")
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\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"store_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"amount": "199.99",
"api_client_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"employee_id": "<string>",
"idempotency_key": "<string>",
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_id": "<string>",
"type": "book_transfer",
"updated_at": "2023-11-07T05:31:56Z",
"user_id": "<string>"
}{
"error_code": "duplicate_idempotency_key"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Create a gift card transaction
Records a credit or debit against a specific gift card and moves its balance by the amount. Supply an idempotency key so a retry returns the transaction already recorded rather than moving the balance twice.
curl --request POST \
--url https://api.vori.com/v1/gift-cards/{id}/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "199.99",
"idempotency_key": "<string>",
"description": "<string>",
"employee_id": "<string>",
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_id": "<string>"
}
'import requests
url = "https://api.vori.com/v1/gift-cards/{id}/transactions"
payload = {
"amount": "199.99",
"idempotency_key": "<string>",
"description": "<string>",
"employee_id": "<string>",
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_id": "<string>"
}
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: '199.99',
idempotency_key: '<string>',
description: '<string>',
employee_id: '<string>',
order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
store_id: '<string>'
})
};
fetch('https://api.vori.com/v1/gift-cards/{id}/transactions', 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.vori.com/v1/gift-cards/{id}/transactions",
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' => '199.99',
'idempotency_key' => '<string>',
'description' => '<string>',
'employee_id' => '<string>',
'order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'store_id' => '<string>'
]),
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.vori.com/v1/gift-cards/{id}/transactions"
payload := strings.NewReader("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"store_id\": \"<string>\"\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.vori.com/v1/gift-cards/{id}/transactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"store_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/gift-cards/{id}/transactions")
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\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"store_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"amount": "199.99",
"api_client_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"employee_id": "<string>",
"idempotency_key": "<string>",
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_id": "<string>",
"type": "book_transfer",
"updated_at": "2023-11-07T05:31:56Z",
"user_id": "<string>"
}{
"error_code": "duplicate_idempotency_key"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Amount to be added or removed from the gift card
^-?[0-9]+(\.[0-9]+)?$"199.99"
Idempotency key to avoid duplicate transactions. Only one transaction may exist with a given idempotency key. Subsequent requests with the same idempotency key will return the data persisted in the database.
The kind of transaction. An API client may send manual_adjustment to correct a balance, or order_payment to spend the card on an order; the remaining types are recorded at the point of sale.
book_transfer, funding_from_payment, manual_adjustment, order_payment Description to write alongside the transaction
ID of the employee responsible. Only a register sends one, and it is required there; a back-office session records the signed-in user, and an API credential records itself.
ID of the order this transaction is tied to, from the transactions resource. Required when spending the card on an order, and rejected on an adjustment. The order does not have to be recorded yet: send the ID you will record it under.
ID of the store the transaction belongs to. Optional: name a store to attribute the adjustment to it, or omit it for one that is not tied to a store.
^[0-9]+$Response
Gift card transaction created successfully.
One credit or debit on a gift card. The ledger is append-only, so a transaction is never edited or removed once recorded; a correction is another transaction.
Unique identifier for the record.
Money the transaction moved on the card. A positive amount adds funds; a negative amount spends them.
^-?[0-9]+(\.[0-9]+)?$"199.99"
ID of the API credential that recorded the transaction. Null when a person did.
When the record was created.
Note written alongside the transaction, such as why an adjustment was made.
When the transaction took effect. A sale carries the time it was completed at the register, so this can be earlier than created_at, which is when the transaction was recorded on the ledger.
ID of the employee who took the transaction at a register, or null when it was made in the back office or by an API credential.
^[0-9]+$Key supplied when the transaction was created, unique within the banner. Sending the same key again returns the transaction already recorded rather than moving the balance twice.
ID of the order this transaction is tied to, from the transactions resource. Null when the transaction is not tied to an order.
ID of the store where the transaction took place. Null for a transaction not tied to a store, such as a back-office adjustment.
^[0-9]+$What produced the transaction: funds loaded onto the card, the card spent on a sale or restored by a refund, or a back-office adjustment.
book_transfer, funding_from_payment, manual_adjustment, order_payment When the record was last changed.
ID of the back-office user who made the transaction. Null for a transaction taken at a register or by an API credential.
^[0-9]+$Was this page helpful?