curl --request POST \
--url https://api.vori.com/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "199.99",
"idempotency_key": "<string>",
"payment_id": "<string>",
"store_id": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
}
}
'import requests
url = "https://api.vori.com/v1/refunds"
payload = {
"amount": "199.99",
"idempotency_key": "<string>",
"payment_id": "<string>",
"store_id": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
}
}
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>',
payment_id: '<string>',
store_id: '<string>',
metadata: {order_source: 'shopify', fulfillment_id: '88213'}
})
};
fetch('https://api.vori.com/v1/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/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([
'amount' => '199.99',
'idempotency_key' => '<string>',
'payment_id' => '<string>',
'store_id' => '<string>',
'metadata' => [
'order_source' => 'shopify',
'fulfillment_id' => '88213'
]
]),
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/refunds"
payload := strings.NewReader("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"payment_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n }\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/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"payment_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/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 \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"payment_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"amount": "199.99",
"created_at": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"mode": "live",
"payment_id": "<string>",
"processor": "datacap",
"status": "authorized",
"store_id": "<string>",
"type": "return",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_code": "duplicate_idempotency_key"
}{
"error_code": "refund_declined",
"error_details": {
"processor_message": "<string>",
"refund_id": "<string>"
}
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}{
"error_code": "refund_in_progress",
"error_details": {
"refund_id": "<string>"
}
}{
"error_code": "payment_processor_timeout",
"error_details": {
"payment_id": "<string>",
"refund_id": "<string>"
}
}Create a refund
Gives money back from a payment taken through Vori. A refund of the whole payment cancels it when the processor still allows that, and otherwise sends the money back to the card. A refund of part of a payment always sends the money back to the card. Refunds are capped at what remains of the payment, and retrying with the same idempotency_key returns the refund already made instead of refunding again. If the processor does not answer, the refund is held back from reads and this call returns a gateway timeout. The money may still have moved, so the refund goes on holding that part of the payment until its outcome is known. Retrying with the same idempotency_key reports it as still in progress while the processor may be working on it, and after that answers with its outcome once the processor can say what happened to it.
curl --request POST \
--url https://api.vori.com/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "199.99",
"idempotency_key": "<string>",
"payment_id": "<string>",
"store_id": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
}
}
'import requests
url = "https://api.vori.com/v1/refunds"
payload = {
"amount": "199.99",
"idempotency_key": "<string>",
"payment_id": "<string>",
"store_id": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
}
}
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>',
payment_id: '<string>',
store_id: '<string>',
metadata: {order_source: 'shopify', fulfillment_id: '88213'}
})
};
fetch('https://api.vori.com/v1/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/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([
'amount' => '199.99',
'idempotency_key' => '<string>',
'payment_id' => '<string>',
'store_id' => '<string>',
'metadata' => [
'order_source' => 'shopify',
'fulfillment_id' => '88213'
]
]),
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/refunds"
payload := strings.NewReader("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"payment_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n }\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/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"payment_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vori.com/v1/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 \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"payment_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"metadata\": {\n \"order_source\": \"shopify\",\n \"fulfillment_id\": \"88213\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"amount": "199.99",
"created_at": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"mode": "live",
"payment_id": "<string>",
"processor": "datacap",
"status": "authorized",
"store_id": "<string>",
"type": "return",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_code": "duplicate_idempotency_key"
}{
"error_code": "refund_declined",
"error_details": {
"processor_message": "<string>",
"refund_id": "<string>"
}
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}{
"error_code": "refund_in_progress",
"error_details": {
"refund_id": "<string>"
}
}{
"error_code": "payment_processor_timeout",
"error_details": {
"payment_id": "<string>",
"refund_id": "<string>"
}
}403 Forbidden.Authorizations
Body
Gives money back from a payment taken through the Vori API, using the payment processor that took it.
Your own key/value pairs, stored as sent 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"
}
Response
A refund of a card payment taken through the Vori API. One refund is one attempt to give money back, and a refund is never edited once the processor has answered.
Where the refund stands: captured once the money was given back, and failed when the processor refused it. A refund is never authorized. A refund the processor has not answered for yet is not served at all, and goes on holding that part of the payment until its outcome is known.
authorized, captured, failed Was this page helpful?