Create or fund a gift card
curl --request POST \
--url https://api.vori.com/v1/gift-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "199.99",
"idempotency_key": "<string>",
"account_number": "<string>",
"description": "<string>",
"employee_id": "<string>",
"order_id": "<string>",
"physical_barcode": "<string>",
"purchaser_phone_number": "<string>",
"recipient_phone_number": "<string>",
"store_id": "<string>"
}
'import requests
url = "https://api.vori.com/v1/gift-cards"
payload = {
"amount": "199.99",
"idempotency_key": "<string>",
"account_number": "<string>",
"description": "<string>",
"employee_id": "<string>",
"order_id": "<string>",
"physical_barcode": "<string>",
"purchaser_phone_number": "<string>",
"recipient_phone_number": "<string>",
"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>',
account_number: '<string>',
description: '<string>',
employee_id: '<string>',
order_id: '<string>',
physical_barcode: '<string>',
purchaser_phone_number: '<string>',
recipient_phone_number: '<string>',
store_id: '<string>'
})
};
fetch('https://api.vori.com/v1/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.vori.com/v1/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' => '199.99',
'idempotency_key' => '<string>',
'account_number' => '<string>',
'description' => '<string>',
'employee_id' => '<string>',
'order_id' => '<string>',
'physical_barcode' => '<string>',
'purchaser_phone_number' => '<string>',
'recipient_phone_number' => '<string>',
'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"
payload := strings.NewReader("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"account_number\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"<string>\",\n \"physical_barcode\": \"<string>\",\n \"purchaser_phone_number\": \"<string>\",\n \"recipient_phone_number\": \"<string>\",\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"account_number\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"<string>\",\n \"physical_barcode\": \"<string>\",\n \"purchaser_phone_number\": \"<string>\",\n \"recipient_phone_number\": \"<string>\",\n \"store_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/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\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"account_number\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"<string>\",\n \"physical_barcode\": \"<string>\",\n \"purchaser_phone_number\": \"<string>\",\n \"recipient_phone_number\": \"<string>\",\n \"store_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"balance": "199.99",
"barcodes": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"deactivated_at": "2023-11-07T05:31:56Z",
"deactivated_by_api_client_id": "<string>",
"deactivated_by_employee_id": "<string>",
"deactivated_by_user_id": "<string>",
"deactivation_reason": "<string>",
"last_order_at": "2023-11-07T05:31:56Z",
"magstripe_account_numbers": [
"<string>"
],
"owner_id": "<string>",
"printed_account_numbers": [
"<string>"
],
"purchaser_id": "<string>",
"shopper_facing_id": "<string>",
"status": "active",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_code": "invalid_employee"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Gift cards
Create or fund a gift card
Funds a shopper’s gift card, creating one if the shopper has none yet, and adjusts its balance.
POST
/
v1
/
gift-cards
Create or fund a gift card
curl --request POST \
--url https://api.vori.com/v1/gift-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "199.99",
"idempotency_key": "<string>",
"account_number": "<string>",
"description": "<string>",
"employee_id": "<string>",
"order_id": "<string>",
"physical_barcode": "<string>",
"purchaser_phone_number": "<string>",
"recipient_phone_number": "<string>",
"store_id": "<string>"
}
'import requests
url = "https://api.vori.com/v1/gift-cards"
payload = {
"amount": "199.99",
"idempotency_key": "<string>",
"account_number": "<string>",
"description": "<string>",
"employee_id": "<string>",
"order_id": "<string>",
"physical_barcode": "<string>",
"purchaser_phone_number": "<string>",
"recipient_phone_number": "<string>",
"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>',
account_number: '<string>',
description: '<string>',
employee_id: '<string>',
order_id: '<string>',
physical_barcode: '<string>',
purchaser_phone_number: '<string>',
recipient_phone_number: '<string>',
store_id: '<string>'
})
};
fetch('https://api.vori.com/v1/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.vori.com/v1/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' => '199.99',
'idempotency_key' => '<string>',
'account_number' => '<string>',
'description' => '<string>',
'employee_id' => '<string>',
'order_id' => '<string>',
'physical_barcode' => '<string>',
'purchaser_phone_number' => '<string>',
'recipient_phone_number' => '<string>',
'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"
payload := strings.NewReader("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"account_number\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"<string>\",\n \"physical_barcode\": \"<string>\",\n \"purchaser_phone_number\": \"<string>\",\n \"recipient_phone_number\": \"<string>\",\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"account_number\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"<string>\",\n \"physical_barcode\": \"<string>\",\n \"purchaser_phone_number\": \"<string>\",\n \"recipient_phone_number\": \"<string>\",\n \"store_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/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\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"account_number\": \"<string>\",\n \"description\": \"<string>\",\n \"employee_id\": \"<string>\",\n \"order_id\": \"<string>\",\n \"physical_barcode\": \"<string>\",\n \"purchaser_phone_number\": \"<string>\",\n \"recipient_phone_number\": \"<string>\",\n \"store_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"balance": "199.99",
"barcodes": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"deactivated_at": "2023-11-07T05:31:56Z",
"deactivated_by_api_client_id": "<string>",
"deactivated_by_employee_id": "<string>",
"deactivated_by_user_id": "<string>",
"deactivation_reason": "<string>",
"last_order_at": "2023-11-07T05:31:56Z",
"magstripe_account_numbers": [
"<string>"
],
"owner_id": "<string>",
"printed_account_numbers": [
"<string>"
],
"purchaser_id": "<string>",
"shopper_facing_id": "<string>",
"status": "active",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_code": "invalid_employee"
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}Authorizations
Body
application/json
Response
Gift card funded successfully.
A prepaid balance a shopper spends at the register. It can be digital, tied to a shopper, or backed by one or more physical cards. A gift card belongs to the banner rather than to any one store, and can be sold, redeemed, or reloaded at any of its registers.
Was this page helpful?