curl --request POST \
--url https://api.vori.com/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "199.99",
"idempotency_key": "<string>",
"store_id": "<string>",
"token": "<string>",
"amount_details": {
"line_items": [
{
"quantity": 2,
"unit_cost": "199.99",
"commodity_code": "50131700",
"product_code": "SKU002",
"product_name": "Organic bananas"
}
],
"tax": {
"total_tax_amount": "199.99"
}
},
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
}
}
'import requests
url = "https://api.vori.com/v1/payments"
payload = {
"amount": "199.99",
"idempotency_key": "<string>",
"store_id": "<string>",
"token": "<string>",
"amount_details": {
"line_items": [
{
"quantity": 2,
"unit_cost": "199.99",
"commodity_code": "50131700",
"product_code": "SKU002",
"product_name": "Organic bananas"
}
],
"tax": { "total_tax_amount": "199.99" }
},
"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>',
store_id: '<string>',
token: '<string>',
amount_details: {
line_items: [
{
quantity: 2,
unit_cost: '199.99',
commodity_code: '50131700',
product_code: 'SKU002',
product_name: 'Organic bananas'
}
],
tax: {total_tax_amount: '199.99'}
},
metadata: {order_source: 'shopify', fulfillment_id: '88213'}
})
};
fetch('https://api.vori.com/v1/payments', 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/payments",
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>',
'store_id' => '<string>',
'token' => '<string>',
'amount_details' => [
'line_items' => [
[
'quantity' => 2,
'unit_cost' => '199.99',
'commodity_code' => '50131700',
'product_code' => 'SKU002',
'product_name' => 'Organic bananas'
]
],
'tax' => [
'total_tax_amount' => '199.99'
]
],
'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/payments"
payload := strings.NewReader("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"store_id\": \"<string>\",\n \"token\": \"<string>\",\n \"amount_details\": {\n \"line_items\": [\n {\n \"quantity\": 2,\n \"unit_cost\": \"199.99\",\n \"commodity_code\": \"50131700\",\n \"product_code\": \"SKU002\",\n \"product_name\": \"Organic bananas\"\n }\n ],\n \"tax\": {\n \"total_tax_amount\": \"199.99\"\n }\n },\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/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"store_id\": \"<string>\",\n \"token\": \"<string>\",\n \"amount_details\": {\n \"line_items\": [\n {\n \"quantity\": 2,\n \"unit_cost\": \"199.99\",\n \"commodity_code\": \"50131700\",\n \"product_code\": \"SKU002\",\n \"product_name\": \"Organic bananas\"\n }\n ],\n \"tax\": {\n \"total_tax_amount\": \"199.99\"\n }\n },\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/payments")
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 \"store_id\": \"<string>\",\n \"token\": \"<string>\",\n \"amount_details\": {\n \"line_items\": [\n {\n \"quantity\": 2,\n \"unit_cost\": \"199.99\",\n \"commodity_code\": \"50131700\",\n \"product_code\": \"SKU002\",\n \"product_name\": \"Organic bananas\"\n }\n ],\n \"tax\": {\n \"total_tax_amount\": \"199.99\"\n }\n },\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",
"amount_details": {
"line_items": [
{
"quantity": 2,
"unit_cost": "199.99",
"commodity_code": "50131700",
"product_code": "SKU002",
"product_name": "Organic bananas",
"unit_of_measure": "box"
}
],
"tax": {
"total_tax_amount": "199.99"
}
},
"amount_refunded": "199.99",
"created_at": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"mode": "live",
"payment_details": {
"order_reference": "PO15938"
},
"payment_method": {
"brand": "american_express",
"last4": "1111",
"type": "ach_debit"
},
"processor": "datacap",
"status": "authorized",
"store_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_code": "duplicate_idempotency_key"
}{
"error_code": "card_declined",
"error_details": {
"payment_id": "<string>",
"processor_message": "<string>"
}
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}{
"error_code": "payment_in_progress",
"error_details": {
"payment_id": "<string>"
}
}{
"error_code": "payment_processor_timeout",
"error_details": {
"payment_id": "<string>",
"refund_id": "<string>"
}
}Create a payment
Charges a card your site or app tokenized in the browser, through the payment processor configured for the store. Retrying with the same idempotency_key returns the payment already taken instead of charging the card again, and answers a refused card with the same failure. If the processor does not answer, the payment is held back from reads and this call returns a gateway timeout. Vori settles the payment from what the processor has on record, on its own within minutes or sooner when you retry with the same idempotency_key, and the retry answers with the outcome once it is known. A payment the processor never received settles as declined and is never charged later, so charge the card again with a new idempotency_key. Sending the sales tax, your order reference and the line items with the charge qualifies commercial and purchasing cards for the lower Level 2 and Level 3 interchange rates; the line items and tax must add up to the amount or the payment is refused before anything is charged.
curl --request POST \
--url https://api.vori.com/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "199.99",
"idempotency_key": "<string>",
"store_id": "<string>",
"token": "<string>",
"amount_details": {
"line_items": [
{
"quantity": 2,
"unit_cost": "199.99",
"commodity_code": "50131700",
"product_code": "SKU002",
"product_name": "Organic bananas"
}
],
"tax": {
"total_tax_amount": "199.99"
}
},
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
}
}
'import requests
url = "https://api.vori.com/v1/payments"
payload = {
"amount": "199.99",
"idempotency_key": "<string>",
"store_id": "<string>",
"token": "<string>",
"amount_details": {
"line_items": [
{
"quantity": 2,
"unit_cost": "199.99",
"commodity_code": "50131700",
"product_code": "SKU002",
"product_name": "Organic bananas"
}
],
"tax": { "total_tax_amount": "199.99" }
},
"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>',
store_id: '<string>',
token: '<string>',
amount_details: {
line_items: [
{
quantity: 2,
unit_cost: '199.99',
commodity_code: '50131700',
product_code: 'SKU002',
product_name: 'Organic bananas'
}
],
tax: {total_tax_amount: '199.99'}
},
metadata: {order_source: 'shopify', fulfillment_id: '88213'}
})
};
fetch('https://api.vori.com/v1/payments', 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/payments",
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>',
'store_id' => '<string>',
'token' => '<string>',
'amount_details' => [
'line_items' => [
[
'quantity' => 2,
'unit_cost' => '199.99',
'commodity_code' => '50131700',
'product_code' => 'SKU002',
'product_name' => 'Organic bananas'
]
],
'tax' => [
'total_tax_amount' => '199.99'
]
],
'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/payments"
payload := strings.NewReader("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"store_id\": \"<string>\",\n \"token\": \"<string>\",\n \"amount_details\": {\n \"line_items\": [\n {\n \"quantity\": 2,\n \"unit_cost\": \"199.99\",\n \"commodity_code\": \"50131700\",\n \"product_code\": \"SKU002\",\n \"product_name\": \"Organic bananas\"\n }\n ],\n \"tax\": {\n \"total_tax_amount\": \"199.99\"\n }\n },\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/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"199.99\",\n \"idempotency_key\": \"<string>\",\n \"store_id\": \"<string>\",\n \"token\": \"<string>\",\n \"amount_details\": {\n \"line_items\": [\n {\n \"quantity\": 2,\n \"unit_cost\": \"199.99\",\n \"commodity_code\": \"50131700\",\n \"product_code\": \"SKU002\",\n \"product_name\": \"Organic bananas\"\n }\n ],\n \"tax\": {\n \"total_tax_amount\": \"199.99\"\n }\n },\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/payments")
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 \"store_id\": \"<string>\",\n \"token\": \"<string>\",\n \"amount_details\": {\n \"line_items\": [\n {\n \"quantity\": 2,\n \"unit_cost\": \"199.99\",\n \"commodity_code\": \"50131700\",\n \"product_code\": \"SKU002\",\n \"product_name\": \"Organic bananas\"\n }\n ],\n \"tax\": {\n \"total_tax_amount\": \"199.99\"\n }\n },\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",
"amount_details": {
"line_items": [
{
"quantity": 2,
"unit_cost": "199.99",
"commodity_code": "50131700",
"product_code": "SKU002",
"product_name": "Organic bananas",
"unit_of_measure": "box"
}
],
"tax": {
"total_tax_amount": "199.99"
}
},
"amount_refunded": "199.99",
"created_at": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>",
"metadata": {
"order_source": "shopify",
"fulfillment_id": "88213"
},
"mode": "live",
"payment_details": {
"order_reference": "PO15938"
},
"payment_method": {
"brand": "american_express",
"last4": "1111",
"type": "ach_debit"
},
"processor": "datacap",
"status": "authorized",
"store_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error_code": "duplicate_idempotency_key"
}{
"error_code": "card_declined",
"error_details": {
"payment_id": "<string>",
"processor_message": "<string>"
}
}{
"error_code": "insufficient_permissions",
"error_details": {
"action": "*",
"resource": "*"
}
}{
"error_code": "payment_in_progress",
"error_details": {
"payment_id": "<string>"
}
}{
"error_code": "payment_processor_timeout",
"error_details": {
"payment_id": "<string>",
"refund_id": "<string>"
}
}403 Forbidden.Authorizations
Body
Charges a card that your site or app tokenized in the browser, using the payment processor configured for the store.
One-time token returned by the hosted tokenizer for the card being charged. A token is good for a single charge, so a new payment needs a new one. Retrying a payment that timed out may send the token it already has, which is only used if the charge never reached the processor.
256Your 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 card payment taken through the Vori API on behalf of a store. One payment is one charge attempt, and a payment is never edited once the processor has answered.
Where the payment stands: captured once the amount was taken from the card, authorized while the processor only holds it, and failed when the card was refused. A payment the processor has not answered for yet is not served at all: sending the same request again with the same idempotency_key and the same token settles it.
authorized, captured, failed Was this page helpful?