Charge the customer's card
curl --request POST \
--url https://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"opaque_data": {
"dataDescriptor": "<string>",
"dataValue": "<string>"
},
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"email": "<string>",
"phone": "<string>"
}
}
'import requests
url = "https://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay"
payload = {
"opaque_data": {
"dataDescriptor": "<string>",
"dataValue": "<string>"
},
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"email": "<string>",
"phone": "<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({
opaque_data: {dataDescriptor: '<string>', dataValue: '<string>'},
billing: {
first_name: '<string>',
last_name: '<string>',
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
email: '<string>',
phone: '<string>'
}
})
};
fetch('https://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay', 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://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay",
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([
'opaque_data' => [
'dataDescriptor' => '<string>',
'dataValue' => '<string>'
],
'billing' => [
'first_name' => '<string>',
'last_name' => '<string>',
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'email' => '<string>',
'phone' => '<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://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay"
payload := strings.NewReader("{\n \"opaque_data\": {\n \"dataDescriptor\": \"<string>\",\n \"dataValue\": \"<string>\"\n },\n \"billing\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\"\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://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"opaque_data\": {\n \"dataDescriptor\": \"<string>\",\n \"dataValue\": \"<string>\"\n },\n \"billing\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay")
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 \"opaque_data\": {\n \"dataDescriptor\": \"<string>\",\n \"dataValue\": \"<string>\"\n },\n \"billing\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"payment_status": "<string>",
"held_for_review": true,
"transaction_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Store
Charge the customer's card
Pay an order with the single-use token Accept.js produced in your customer’s browser. Card data
never touches your server. A declined card returns 402 card_declined; the customer can try
another card on the same order. Needs store:write.
POST
/
store
/
orders
/
{id}
/
pay
Charge the customer's card
curl --request POST \
--url https://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"opaque_data": {
"dataDescriptor": "<string>",
"dataValue": "<string>"
},
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"email": "<string>",
"phone": "<string>"
}
}
'import requests
url = "https://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay"
payload = {
"opaque_data": {
"dataDescriptor": "<string>",
"dataValue": "<string>"
},
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"email": "<string>",
"phone": "<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({
opaque_data: {dataDescriptor: '<string>', dataValue: '<string>'},
billing: {
first_name: '<string>',
last_name: '<string>',
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
email: '<string>',
phone: '<string>'
}
})
};
fetch('https://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay', 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://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay",
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([
'opaque_data' => [
'dataDescriptor' => '<string>',
'dataValue' => '<string>'
],
'billing' => [
'first_name' => '<string>',
'last_name' => '<string>',
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'email' => '<string>',
'phone' => '<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://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay"
payload := strings.NewReader("{\n \"opaque_data\": {\n \"dataDescriptor\": \"<string>\",\n \"dataValue\": \"<string>\"\n },\n \"billing\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\"\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://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"opaque_data\": {\n \"dataDescriptor\": \"<string>\",\n \"dataValue\": \"<string>\"\n },\n \"billing\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vitarelay.com/api/public/partner/v1/store/orders/{id}/pay")
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 \"opaque_data\": {\n \"dataDescriptor\": \"<string>\",\n \"dataValue\": \"<string>\"\n },\n \"billing\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"payment_status": "<string>",
"held_for_review": true,
"transaction_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
VitaRelay API key (vr_live_... or vr_test_...) with the invites:* scopes.
Path Parameters
Resource UUID.
Body
application/json
Response
Payment result.
Show child attributes
Show child attributes

