Pay or retry an order with an Accept.js token
curl --request POST \
--url https://vitarelay.com/api/public/partner/v1/wholesale/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/wholesale/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/wholesale/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/wholesale/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/wholesale/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/wholesale/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/wholesale/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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": "<string>",
"status": "<string>",
"payment_status": "<string>",
"external_order_id": "<string>",
"subtotal_cents": 123,
"shipping_cents": 123,
"tax_cents": 123,
"total_cents": 123,
"currency": "<string>",
"your_markup_cents": 123,
"ship_to": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"address": {}
},
"items": [
{
"product_id": "<string>",
"name": "<string>",
"quantity": 123,
"unit_price_cents": 123
}
],
"tracking": {
"number": "<string>",
"carrier": "<string>",
"url": "<string>",
"status": "<string>",
"shipped_at": "<string>",
"delivered_at": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
},
"payment": {
"status": "paid",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Wholesale
Pay or retry an order with an Accept.js token
Pay an unpaid order (for example after a declined card) with a new single-use Accept.js token. Card data
never touches your server. A decline returns 402 with payment.status: failed; nothing ships until the
order is paid. Needs orders:write.
POST
/
wholesale
/
orders
/
{id}
/
pay
Pay or retry an order with an Accept.js token
curl --request POST \
--url https://vitarelay.com/api/public/partner/v1/wholesale/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/wholesale/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/wholesale/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/wholesale/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/wholesale/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/wholesale/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/wholesale/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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": "<string>",
"status": "<string>",
"payment_status": "<string>",
"external_order_id": "<string>",
"subtotal_cents": 123,
"shipping_cents": 123,
"tax_cents": 123,
"total_cents": 123,
"currency": "<string>",
"your_markup_cents": 123,
"ship_to": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"address": {}
},
"items": [
{
"product_id": "<string>",
"name": "<string>",
"quantity": 123,
"unit_price_cents": 123
}
],
"tracking": {
"number": "<string>",
"carrier": "<string>",
"url": "<string>",
"status": "<string>",
"shipped_at": "<string>",
"delivered_at": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
},
"payment": {
"status": "paid",
"message": "<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

