curl --request POST \
--url https://api.vori.com/v1/transactions/{id}/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"line_items": [
{
"quantity": "-199.99",
"retail_price": "199.99",
"total": "-199.99",
"transaction_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discount_total": "199.99",
"item_modifiers": [
{
"amount": "-199.99",
"item_modifier_id": "<string>"
}
],
"promo_savings": "199.99",
"return_to_inventory": true,
"tax_total": "-199.99",
"taxable_amount": "-199.99",
"weight": "-199.99"
}
],
"payments": [
{
"amount": "-199.99",
"external_transaction_id": "<string>",
"transaction_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"tax_total": "-199.99",
"total": "-199.99",
"employee_id": "<string>",
"external_id": "<string>",
"lane_id": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"return_to_inventory": true
}
'import requests
url = "https://api.vori.com/v1/transactions/{id}/refunds"
payload = {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"line_items": [
{
"quantity": "-199.99",
"retail_price": "199.99",
"total": "-199.99",
"transaction_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discount_total": "199.99",
"item_modifiers": [
{
"amount": "-199.99",
"item_modifier_id": "<string>"
}
],
"promo_savings": "199.99",
"return_to_inventory": True,
"tax_total": "-199.99",
"taxable_amount": "-199.99",
"weight": "-199.99"
}
],
"payments": [
{
"amount": "-199.99",
"external_transaction_id": "<string>",
"transaction_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"tax_total": "-199.99",
"total": "-199.99",
"employee_id": "<string>",
"external_id": "<string>",
"lane_id": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"return_to_inventory": True
}
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({
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
completed_at: '2023-11-07T05:31:56Z',
line_items: [
{
quantity: '-199.99',
retail_price: '199.99',
total: '-199.99',
transaction_line_item_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
discount_total: '199.99',
item_modifiers: [{amount: '-199.99', item_modifier_id: '<string>'}],
promo_savings: '199.99',
return_to_inventory: true,
tax_total: '-199.99',
taxable_amount: '-199.99',
weight: '-199.99'
}
],
payments: [
{
amount: '-199.99',
external_transaction_id: '<string>',
transaction_payment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
completed_at: '2023-11-07T05:31:56Z'
}
],
tax_total: '-199.99',
total: '-199.99',
employee_id: '<string>',
external_id: '<string>',
lane_id: '<string>',
metadata: {order_source: 'shopify', fulfillment_id: '88213'},
return_to_inventory: true
})
};
fetch('https://api.vori.com/v1/transactions/{id}/refunds', 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/transactions/{id}/refunds",
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([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'completed_at' => '2023-11-07T05:31:56Z',
'line_items' => [
[
'quantity' => '-199.99',
'retail_price' => '199.99',
'total' => '-199.99',
'transaction_line_item_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'discount_total' => '199.99',
'item_modifiers' => [
[
'amount' => '-199.99',
'item_modifier_id' => '<string>'
]
],
'promo_savings' => '199.99',
'return_to_inventory' => true,
'tax_total' => '-199.99',
'taxable_amount' => '-199.99',
'weight' => '-199.99'
]
],
'payments' => [
[
'amount' => '-199.99',
'external_transaction_id' => '<string>',
'transaction_payment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'completed_at' => '2023-11-07T05:31:56Z'
]
],
'tax_total' => '-199.99',
'total' => '-199.99',
'employee_id' => '<string>',
'external_id' => '<string>',
'lane_id' => '<string>',
'metadata' => [
'order_source' => 'shopify',
'fulfillment_id' => '88213'
],
'return_to_inventory' => true
]),
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/transactions/{id}/refunds"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"line_items\": [\n {\n \"quantity\": \"-199.99\",\n \"retail_price\": \"199.99\",\n \"total\": \"-199.99\",\n \"transaction_line_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"discount_total\": \"199.99\",\n \"item_modifiers\": [\n {\n \"amount\": \"-199.99\",\n \"item_modifier_id\": \"<string>\"\n }\n ],\n \"promo_savings\": \"199.99\",\n \"return_to_inventory\": true,\n \"tax_total\": \"-199.99\",\n \"taxable_amount\": \"-199.99\",\n \"weight\": \"-199.99\"\n }\n ],\n \"payments\": [\n {\n \"amount\": \"-199.99\",\n \"external_transaction_id\": \"<string>\",\n \"transaction_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tax_total\": \"-199.99\",\n \"total\": \"-199.99\",\n \"employee_id\": \"<string>\",\n \"external_id\": \"<string>\",\n \"lane_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n },\n \"return_to_inventory\": true\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/transactions/{id}/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"line_items\": [\n {\n \"quantity\": \"-199.99\",\n \"retail_price\": \"199.99\",\n \"total\": \"-199.99\",\n \"transaction_line_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"discount_total\": \"199.99\",\n \"item_modifiers\": [\n {\n \"amount\": \"-199.99\",\n \"item_modifier_id\": \"<string>\"\n }\n ],\n \"promo_savings\": \"199.99\",\n \"return_to_inventory\": true,\n \"tax_total\": \"-199.99\",\n \"taxable_amount\": \"-199.99\",\n \"weight\": \"-199.99\"\n }\n ],\n \"payments\": [\n {\n \"amount\": \"-199.99\",\n \"external_transaction_id\": \"<string>\",\n \"transaction_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tax_total\": \"-199.99\",\n \"total\": \"-199.99\",\n \"employee_id\": \"<string>\",\n \"external_id\": \"<string>\",\n \"lane_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n },\n \"return_to_inventory\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/transactions/{id}/refunds")
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 \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"line_items\": [\n {\n \"quantity\": \"-199.99\",\n \"retail_price\": \"199.99\",\n \"total\": \"-199.99\",\n \"transaction_line_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"discount_total\": \"199.99\",\n \"item_modifiers\": [\n {\n \"amount\": \"-199.99\",\n \"item_modifier_id\": \"<string>\"\n }\n ],\n \"promo_savings\": \"199.99\",\n \"return_to_inventory\": true,\n \"tax_total\": \"-199.99\",\n \"taxable_amount\": \"-199.99\",\n \"weight\": \"-199.99\"\n }\n ],\n \"payments\": [\n {\n \"amount\": \"-199.99\",\n \"external_transaction_id\": \"<string>\",\n \"transaction_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tax_total\": \"-199.99\",\n \"total\": \"-199.99\",\n \"employee_id\": \"<string>\",\n \"external_id\": \"<string>\",\n \"lane_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n },\n \"return_to_inventory\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"cashback_amount": "199.99",
"completed_at": "2023-11-07T05:31:56Z",
"coupon_total": "199.99",
"discount_total": "199.99",
"employee_id": "<string>",
"external_id": "<string>",
"gift_card_sales": [
{
"id": "<string>",
"amount": "199.99",
"gift_card_id": "<string>",
"gift_card_transaction_id": "<string>"
}
],
"gift_card_sales_total": "199.99",
"issued_coupons": [
{
"id": "<string>",
"coupon_code": "<string>",
"coupon_id": "<string>",
"ended_at": "2023-11-07T05:31:56Z",
"offer_benefit_value": "199.99",
"snap_incentive_program_id": "<string>",
"started_at": "2023-11-07T05:31:56Z"
}
],
"item_modifier_total": "199.99",
"lane_id": "<string>",
"line_items": [
{
"id": "<string>",
"coupon_total": "199.99",
"coupons": [
{
"id": "<string>",
"applied_amount": "199.99",
"coupon_code": "<string>",
"coupon_id": "<string>",
"offer_display_text": "<string>",
"offer_id": "<string>"
}
],
"department_id": "<string>",
"discount_total": "199.99",
"discounts": [
{
"id": "<string>",
"applied_amount": "199.99",
"discount_id": "<string>",
"discount_name": "<string>",
"discount_type": "amount_off",
"discount_value": "199.99"
}
],
"ebt_tax_waived_total": "199.99",
"free_quantity": "199.99",
"item_modifier_total": "199.99",
"item_modifiers": [
{
"id": "<string>",
"amount": "199.99",
"item_modifier_id": "<string>",
"quantity": "199.99",
"tax_amount": "199.99",
"taxes": [
{
"id": "<string>",
"amount": "199.99",
"tax_rate": {
"id": "<string>",
"category": "other",
"name": "<string>",
"value": "8.25",
"value_type": "amount"
}
}
]
}
],
"loyalty_rewards": [
{
"id": "<string>",
"applied_amount": "199.99",
"loyalty_reward_id": "<string>",
"loyalty_reward_name": "<string>",
"offer_id": "<string>",
"order_loyalty_reward_id": "<string>"
}
],
"loyalty_rewards_total": "199.99",
"product": {
"id": "<string>",
"barcode": "<string>",
"brand": "<string>",
"ebt_enabled": true,
"name": "<string>",
"sold_by_weight": true,
"unit_of_measure": "<string>",
"unit_of_measure_amount": "199.99",
"wic_enabled": true
},
"promo_savings": "199.99",
"promotions": [
{
"id": "<string>",
"amount": "199.99",
"display_text": "<string>",
"offer_id": "<string>",
"promotion_id": "<string>",
"savings": "199.99"
}
],
"quantity": "199.99",
"refunded_order_line_item_id": "<string>",
"retail_price": "199.99",
"retail_total": "199.99",
"subtotal": "199.99",
"tax_total": "199.99",
"taxable_amount": "199.99",
"taxes": [
{
"id": "<string>",
"amount": "199.99",
"tax_rate": {
"id": "<string>",
"category": "other",
"name": "<string>",
"value": "8.25",
"value_type": "amount"
}
}
],
"total": "199.99",
"transaction_type": "refund",
"type": "refund",
"variable_weights": [
{
"id": "<string>",
"variable_weight": {
"id": "<string>",
"name": "<string>",
"unit": "LBS",
"value": "199.99"
}
}
],
"wic_adjusted_price": "199.99"
}
],
"loyalty_rewards_total": "199.99",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"payments": [
{
"id": "<string>",
"authorized_amount": "199.99",
"card_brand": "american_express",
"card_last4": "<string>",
"cash_received": "199.99",
"cashback_amount": "199.99",
"change_returned": "199.99",
"completed_at": "2023-11-07T05:31:56Z",
"payment_type": "cash",
"requested_amount": "199.99",
"reversals": [
{
"id": "<string>",
"authorized_amount": "199.99",
"card_brand": "american_express",
"card_last4": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"payment_type": "cash",
"requested_amount": "199.99"
}
],
"terminal_was_online": true,
"till_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tip_amount": "199.99"
}
],
"points_earned": "199.99",
"promo_savings": "199.99",
"promo_total": "199.99",
"receipt_type": "email",
"refund_total": "199.99",
"refunds": [
{
"id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"employee_id": "<string>",
"lane_id": "<string>",
"shopper_facing_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"store_id": "<string>",
"subtotal": "199.99",
"tax_total": "199.99",
"total": "199.99"
}
],
"retail_total": "199.99",
"shopper_facing_id": "<string>",
"shopper_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "api",
"started_at": "2023-11-07T05:31:56Z",
"status": "completed",
"store_id": "<string>",
"subtotal": "199.99",
"tax_total": "199.99",
"taxable_amount": "199.99",
"tip_amount": "199.99",
"total": "199.99",
"total_collected": "199.99",
"type": "refund"
}{
"error_code": "transaction_lane_not_found",
"error_details": {
"lane_id": "<string>"
}
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}{
"error_code": "transaction_already_exists",
"error_details": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Refund a transaction
Records a refund your own system processed against a transaction Vori already recorded, and returns it as a transaction of its own. Only a transaction created through this API can be refunded. Quantities and amounts are negative, as they are when you read a refund back, and a line cannot return more than it has left after earlier refunds. Send a UUIDv7 as id; sending the same refund again under that ID returns the refund already recorded rather than creating a second, and sending different values under it is rejected.
curl --request POST \
--url https://api.vori.com/v1/transactions/{id}/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"line_items": [
{
"quantity": "-199.99",
"retail_price": "199.99",
"total": "-199.99",
"transaction_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discount_total": "199.99",
"item_modifiers": [
{
"amount": "-199.99",
"item_modifier_id": "<string>"
}
],
"promo_savings": "199.99",
"return_to_inventory": true,
"tax_total": "-199.99",
"taxable_amount": "-199.99",
"weight": "-199.99"
}
],
"payments": [
{
"amount": "-199.99",
"external_transaction_id": "<string>",
"transaction_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"tax_total": "-199.99",
"total": "-199.99",
"employee_id": "<string>",
"external_id": "<string>",
"lane_id": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"return_to_inventory": true
}
'import requests
url = "https://api.vori.com/v1/transactions/{id}/refunds"
payload = {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z",
"line_items": [
{
"quantity": "-199.99",
"retail_price": "199.99",
"total": "-199.99",
"transaction_line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discount_total": "199.99",
"item_modifiers": [
{
"amount": "-199.99",
"item_modifier_id": "<string>"
}
],
"promo_savings": "199.99",
"return_to_inventory": True,
"tax_total": "-199.99",
"taxable_amount": "-199.99",
"weight": "-199.99"
}
],
"payments": [
{
"amount": "-199.99",
"external_transaction_id": "<string>",
"transaction_payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"tax_total": "-199.99",
"total": "-199.99",
"employee_id": "<string>",
"external_id": "<string>",
"lane_id": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"return_to_inventory": True
}
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({
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
completed_at: '2023-11-07T05:31:56Z',
line_items: [
{
quantity: '-199.99',
retail_price: '199.99',
total: '-199.99',
transaction_line_item_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
discount_total: '199.99',
item_modifiers: [{amount: '-199.99', item_modifier_id: '<string>'}],
promo_savings: '199.99',
return_to_inventory: true,
tax_total: '-199.99',
taxable_amount: '-199.99',
weight: '-199.99'
}
],
payments: [
{
amount: '-199.99',
external_transaction_id: '<string>',
transaction_payment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
completed_at: '2023-11-07T05:31:56Z'
}
],
tax_total: '-199.99',
total: '-199.99',
employee_id: '<string>',
external_id: '<string>',
lane_id: '<string>',
metadata: {order_source: 'shopify', fulfillment_id: '88213'},
return_to_inventory: true
})
};
fetch('https://api.vori.com/v1/transactions/{id}/refunds', 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/transactions/{id}/refunds",
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([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'completed_at' => '2023-11-07T05:31:56Z',
'line_items' => [
[
'quantity' => '-199.99',
'retail_price' => '199.99',
'total' => '-199.99',
'transaction_line_item_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'discount_total' => '199.99',
'item_modifiers' => [
[
'amount' => '-199.99',
'item_modifier_id' => '<string>'
]
],
'promo_savings' => '199.99',
'return_to_inventory' => true,
'tax_total' => '-199.99',
'taxable_amount' => '-199.99',
'weight' => '-199.99'
]
],
'payments' => [
[
'amount' => '-199.99',
'external_transaction_id' => '<string>',
'transaction_payment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'completed_at' => '2023-11-07T05:31:56Z'
]
],
'tax_total' => '-199.99',
'total' => '-199.99',
'employee_id' => '<string>',
'external_id' => '<string>',
'lane_id' => '<string>',
'metadata' => [
'order_source' => 'shopify',
'fulfillment_id' => '88213'
],
'return_to_inventory' => true
]),
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/transactions/{id}/refunds"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"line_items\": [\n {\n \"quantity\": \"-199.99\",\n \"retail_price\": \"199.99\",\n \"total\": \"-199.99\",\n \"transaction_line_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"discount_total\": \"199.99\",\n \"item_modifiers\": [\n {\n \"amount\": \"-199.99\",\n \"item_modifier_id\": \"<string>\"\n }\n ],\n \"promo_savings\": \"199.99\",\n \"return_to_inventory\": true,\n \"tax_total\": \"-199.99\",\n \"taxable_amount\": \"-199.99\",\n \"weight\": \"-199.99\"\n }\n ],\n \"payments\": [\n {\n \"amount\": \"-199.99\",\n \"external_transaction_id\": \"<string>\",\n \"transaction_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tax_total\": \"-199.99\",\n \"total\": \"-199.99\",\n \"employee_id\": \"<string>\",\n \"external_id\": \"<string>\",\n \"lane_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n },\n \"return_to_inventory\": true\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/transactions/{id}/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"line_items\": [\n {\n \"quantity\": \"-199.99\",\n \"retail_price\": \"199.99\",\n \"total\": \"-199.99\",\n \"transaction_line_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"discount_total\": \"199.99\",\n \"item_modifiers\": [\n {\n \"amount\": \"-199.99\",\n \"item_modifier_id\": \"<string>\"\n }\n ],\n \"promo_savings\": \"199.99\",\n \"return_to_inventory\": true,\n \"tax_total\": \"-199.99\",\n \"taxable_amount\": \"-199.99\",\n \"weight\": \"-199.99\"\n }\n ],\n \"payments\": [\n {\n \"amount\": \"-199.99\",\n \"external_transaction_id\": \"<string>\",\n \"transaction_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tax_total\": \"-199.99\",\n \"total\": \"-199.99\",\n \"employee_id\": \"<string>\",\n \"external_id\": \"<string>\",\n \"lane_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n },\n \"return_to_inventory\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/transactions/{id}/refunds")
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 \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\",\n \"line_items\": [\n {\n \"quantity\": \"-199.99\",\n \"retail_price\": \"199.99\",\n \"total\": \"-199.99\",\n \"transaction_line_item_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"discount_total\": \"199.99\",\n \"item_modifiers\": [\n {\n \"amount\": \"-199.99\",\n \"item_modifier_id\": \"<string>\"\n }\n ],\n \"promo_savings\": \"199.99\",\n \"return_to_inventory\": true,\n \"tax_total\": \"-199.99\",\n \"taxable_amount\": \"-199.99\",\n \"weight\": \"-199.99\"\n }\n ],\n \"payments\": [\n {\n \"amount\": \"-199.99\",\n \"external_transaction_id\": \"<string>\",\n \"transaction_payment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tax_total\": \"-199.99\",\n \"total\": \"-199.99\",\n \"employee_id\": \"<string>\",\n \"external_id\": \"<string>\",\n \"lane_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n },\n \"return_to_inventory\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"cashback_amount": "199.99",
"completed_at": "2023-11-07T05:31:56Z",
"coupon_total": "199.99",
"discount_total": "199.99",
"employee_id": "<string>",
"external_id": "<string>",
"gift_card_sales": [
{
"id": "<string>",
"amount": "199.99",
"gift_card_id": "<string>",
"gift_card_transaction_id": "<string>"
}
],
"gift_card_sales_total": "199.99",
"issued_coupons": [
{
"id": "<string>",
"coupon_code": "<string>",
"coupon_id": "<string>",
"ended_at": "2023-11-07T05:31:56Z",
"offer_benefit_value": "199.99",
"snap_incentive_program_id": "<string>",
"started_at": "2023-11-07T05:31:56Z"
}
],
"item_modifier_total": "199.99",
"lane_id": "<string>",
"line_items": [
{
"id": "<string>",
"coupon_total": "199.99",
"coupons": [
{
"id": "<string>",
"applied_amount": "199.99",
"coupon_code": "<string>",
"coupon_id": "<string>",
"offer_display_text": "<string>",
"offer_id": "<string>"
}
],
"department_id": "<string>",
"discount_total": "199.99",
"discounts": [
{
"id": "<string>",
"applied_amount": "199.99",
"discount_id": "<string>",
"discount_name": "<string>",
"discount_type": "amount_off",
"discount_value": "199.99"
}
],
"ebt_tax_waived_total": "199.99",
"free_quantity": "199.99",
"item_modifier_total": "199.99",
"item_modifiers": [
{
"id": "<string>",
"amount": "199.99",
"item_modifier_id": "<string>",
"quantity": "199.99",
"tax_amount": "199.99",
"taxes": [
{
"id": "<string>",
"amount": "199.99",
"tax_rate": {
"id": "<string>",
"category": "other",
"name": "<string>",
"value": "8.25",
"value_type": "amount"
}
}
]
}
],
"loyalty_rewards": [
{
"id": "<string>",
"applied_amount": "199.99",
"loyalty_reward_id": "<string>",
"loyalty_reward_name": "<string>",
"offer_id": "<string>",
"order_loyalty_reward_id": "<string>"
}
],
"loyalty_rewards_total": "199.99",
"product": {
"id": "<string>",
"barcode": "<string>",
"brand": "<string>",
"ebt_enabled": true,
"name": "<string>",
"sold_by_weight": true,
"unit_of_measure": "<string>",
"unit_of_measure_amount": "199.99",
"wic_enabled": true
},
"promo_savings": "199.99",
"promotions": [
{
"id": "<string>",
"amount": "199.99",
"display_text": "<string>",
"offer_id": "<string>",
"promotion_id": "<string>",
"savings": "199.99"
}
],
"quantity": "199.99",
"refunded_order_line_item_id": "<string>",
"retail_price": "199.99",
"retail_total": "199.99",
"subtotal": "199.99",
"tax_total": "199.99",
"taxable_amount": "199.99",
"taxes": [
{
"id": "<string>",
"amount": "199.99",
"tax_rate": {
"id": "<string>",
"category": "other",
"name": "<string>",
"value": "8.25",
"value_type": "amount"
}
}
],
"total": "199.99",
"transaction_type": "refund",
"type": "refund",
"variable_weights": [
{
"id": "<string>",
"variable_weight": {
"id": "<string>",
"name": "<string>",
"unit": "LBS",
"value": "199.99"
}
}
],
"wic_adjusted_price": "199.99"
}
],
"loyalty_rewards_total": "199.99",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"payments": [
{
"id": "<string>",
"authorized_amount": "199.99",
"card_brand": "american_express",
"card_last4": "<string>",
"cash_received": "199.99",
"cashback_amount": "199.99",
"change_returned": "199.99",
"completed_at": "2023-11-07T05:31:56Z",
"payment_type": "cash",
"requested_amount": "199.99",
"reversals": [
{
"id": "<string>",
"authorized_amount": "199.99",
"card_brand": "american_express",
"card_last4": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"payment_type": "cash",
"requested_amount": "199.99"
}
],
"terminal_was_online": true,
"till_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tip_amount": "199.99"
}
],
"points_earned": "199.99",
"promo_savings": "199.99",
"promo_total": "199.99",
"receipt_type": "email",
"refund_total": "199.99",
"refunds": [
{
"id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"employee_id": "<string>",
"lane_id": "<string>",
"shopper_facing_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"store_id": "<string>",
"subtotal": "199.99",
"tax_total": "199.99",
"total": "199.99"
}
],
"retail_total": "199.99",
"shopper_facing_id": "<string>",
"shopper_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "api",
"started_at": "2023-11-07T05:31:56Z",
"status": "completed",
"store_id": "<string>",
"subtotal": "199.99",
"tax_total": "199.99",
"taxable_amount": "199.99",
"tip_amount": "199.99",
"total": "199.99",
"total_collected": "199.99",
"type": "refund"
}{
"error_code": "transaction_lane_not_found",
"error_details": {
"lane_id": "<string>"
}
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}{
"error_code": "transaction_already_exists",
"error_details": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
A refund your own system processed against a transaction Vori already recorded, with the products coming back and the money going out.
Unique refund ID generated by your system (UUIDv7). It serves as the idempotency key for the request: sending the same refund twice with the same ID returns the refund already recorded rather than creating a duplicate. Generate it before your first attempt and reuse it on every retry. Sending different values under an ID already used is rejected.
When the refund was completed in your system.
Products coming back on the refund.
1 - 2500 elementsShow child attributes
Show child attributes
Payments the refund returns money to.
1 - 50 elementsShow child attributes
Show child attributes
Total sales tax refunded, as a negative amount. Must equal the sum of the line-item tax totals.
^(-[0-9]+(\.[0-9]+)?|0+(\.0+)?)$"-199.99"
Final refund total including tax, as a negative amount. Must equal the sum of the line totals, and the payments must add up to this amount.
^(-[0-9]+(\.[0-9]+)?|0+(\.0+)?)$"-199.99"
ID of the employee to record this refund under. Defaults to the employee Vori maintains for transactions submitted through this API.
^[0-9]+$Your own identifier for this refund, such as a return number from your e-commerce platform. Surrounding whitespace is removed; the value is otherwise stored as provided and never interpreted, and you can filter transactions by it. Vori does not require it to be unique.
255ID of the lane to record this refund under. Defaults to the lane Vori maintains for transactions submitted through this API.
^[0-9]+$Your own key/value pairs, stored with the refund and returned unchanged. Vori never interprets them. Up to 50 keys; key names up to 40 characters of letters, numbers, underscores, and hyphens; values up to 500 characters. Keys beginning with "vori" are reserved. Do not put personal or sensitive information here — these values flow into reporting and data exports.
Show child attributes
Show child attributes
{
"order_source": "shopify",
"fulfillment_id": "88213"
}
Whether the products coming back return to your on-hand counts. Applies to every line that does not answer for itself; a line providing its own return_to_inventory overrides it. Defaults to false. Acted on when the refund is first recorded, so resending the same refund ID does not revisit it.
Response
A completed checkout at a store, covering the lane, cashier, and shopper, the products sold, the savings applied, the payments collected, and any refunds against it.
Unique identifier for the record.
Cash back requested by the shopper.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Date and time when the transaction was finalized.
Total savings from coupons.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Total savings from manual or employee discounts.
^-?[0-9]+(\.[0-9]+)?$"199.99"
ID of the employee who processed the transaction.
^[0-9]+$Your own identifier for the transaction, as supplied when it was recorded.
Gift cards purchased in the transaction.
Show child attributes
Show child attributes
Total face value of gift cards purchased in the transaction.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Coupons issued to the shopper by the transaction.
Show child attributes
Show child attributes
Total value of item modifiers.
^-?[0-9]+(\.[0-9]+)?$"199.99"
ID of the checkout lane that processed the transaction.
^[0-9]+$Product line items included in the transaction.
Show child attributes
Show child attributes
Total savings from loyalty reward redemptions.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Your own key/value pairs, exactly as supplied when the transaction was recorded.
Show child attributes
Show child attributes
{
"order_source": "shopify",
"fulfillment_id": "88213"
}
Payments collected for the transaction.
Show child attributes
Show child attributes
Loyalty points the shopper earned on this transaction, computed from the products sold and the store banner loyalty program. Zero when the transaction names no shopper or the banner has no active loyalty program. Negative on a refund, which reverses the points the original sale earned.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Total savings from promotions.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Sum of line-item totals after promotions are applied.
^-?[0-9]+(\.[0-9]+)?$"199.99"
How the shopper took their receipt, or null when they took none.
email, print, sms Total value refunded against this transaction.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Refunds of the transaction. Retrieve one with GET /v1/transactions/{id} for the products returned and how the money went back.
Show child attributes
Show child attributes
Sum of line-item retail totals after promotions and before discounts and tax.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Human-readable transaction identifier shown to the shopper.
ID of the loyalty shopper associated with the transaction, or null for an anonymous transaction.
Where the transaction came from.
api, migration, pos Date and time when the cashier started the transaction.
Current lifecycle status of the transaction.
completed, expired, suspended, voided ID of the store where the transaction was placed.
^[0-9]+$Sum of line-item subtotals before promotions, discounts, and tax.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Total tax charged on the transaction.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Portion of the transaction subject to tax.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Tip added by the shopper.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Final transaction amount including tax. Sales are positive and refunds are negative.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Total collected from the shopper, including the transaction total, tip, and cash back.
^-?[0-9]+(\.[0-9]+)?$"199.99"
Financial transaction type represented by the transaction.
refund, sale, void Was this page helpful?