Checkout
curl --request POST \
--url https://api.vellaro.io/api/v1/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"address_line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>",
"company": "<string>",
"address_line2": "<string>",
"state": "<string>",
"phone": "<string>"
},
"billing_address": {
"first_name": "<string>",
"last_name": "<string>",
"address_line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>",
"company": "<string>",
"address_line2": "<string>",
"state": "<string>",
"phone": "<string>"
},
"coupon_code": "<string>",
"notes": "<string>",
"locale": "<string>",
"payment_method": "stripe",
"customer_email": "jsmith@example.com",
"subscribe_recurring_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"affiliate_code": "<string>"
}
'import requests
url = "https://api.vellaro.io/api/v1/checkout"
payload = {
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"address_line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>",
"company": "<string>",
"address_line2": "<string>",
"state": "<string>",
"phone": "<string>"
},
"billing_address": {
"first_name": "<string>",
"last_name": "<string>",
"address_line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>",
"company": "<string>",
"address_line2": "<string>",
"state": "<string>",
"phone": "<string>"
},
"coupon_code": "<string>",
"notes": "<string>",
"locale": "<string>",
"payment_method": "stripe",
"customer_email": "jsmith@example.com",
"subscribe_recurring_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"affiliate_code": "<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({
shipping_address: {
first_name: '<string>',
last_name: '<string>',
address_line1: '<string>',
city: '<string>',
postal_code: '<string>',
country: '<string>',
company: '<string>',
address_line2: '<string>',
state: '<string>',
phone: '<string>'
},
billing_address: {
first_name: '<string>',
last_name: '<string>',
address_line1: '<string>',
city: '<string>',
postal_code: '<string>',
country: '<string>',
company: '<string>',
address_line2: '<string>',
state: '<string>',
phone: '<string>'
},
coupon_code: '<string>',
notes: '<string>',
locale: '<string>',
payment_method: 'stripe',
customer_email: 'jsmith@example.com',
subscribe_recurring_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
affiliate_code: '<string>'
})
};
fetch('https://api.vellaro.io/api/v1/checkout', 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.vellaro.io/api/v1/checkout",
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([
'shipping_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'address_line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'country' => '<string>',
'company' => '<string>',
'address_line2' => '<string>',
'state' => '<string>',
'phone' => '<string>'
],
'billing_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'address_line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'country' => '<string>',
'company' => '<string>',
'address_line2' => '<string>',
'state' => '<string>',
'phone' => '<string>'
],
'coupon_code' => '<string>',
'notes' => '<string>',
'locale' => '<string>',
'payment_method' => 'stripe',
'customer_email' => 'jsmith@example.com',
'subscribe_recurring_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'affiliate_code' => '<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://api.vellaro.io/api/v1/checkout"
payload := strings.NewReader("{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"notes\": \"<string>\",\n \"locale\": \"<string>\",\n \"payment_method\": \"stripe\",\n \"customer_email\": \"jsmith@example.com\",\n \"subscribe_recurring_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"affiliate_code\": \"<string>\"\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.vellaro.io/api/v1/checkout")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"notes\": \"<string>\",\n \"locale\": \"<string>\",\n \"payment_method\": \"stripe\",\n \"customer_email\": \"jsmith@example.com\",\n \"subscribe_recurring_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"affiliate_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/checkout")
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 \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"notes\": \"<string>\",\n \"locale\": \"<string>\",\n \"payment_method\": \"stripe\",\n \"customer_email\": \"jsmith@example.com\",\n \"subscribe_recurring_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"affiliate_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_method": "<string>",
"subtotal": "<string>",
"shipping_cost": "<string>",
"tax": "<string>",
"discount_amount": "<string>",
"total": "<string>",
"currency": "<string>",
"client_secret": "<string>",
"stripe_publishable_key": "",
"paypal_order_id": "<string>",
"paypal_client_id": "<string>",
"pok_order_id": "<string>",
"pok_env": "<string>",
"paysera_redirect_url": "<string>",
"bank_details": {},
"tax_rate": "<string>",
"prices_include_tax": false
},
"meta": {
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
},
"error": "<string>",
"error_code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}orders
Checkout
Create a Stripe PaymentIntent and a pending Order from the current cart.
Returns a client_secret that the frontend passes to stripe.confirmPayment().
For COD / bank transfer, client_secret is null and the order goes straight to
pending status awaiting manual confirmation.
POST
/
api
/
v1
/
checkout
Checkout
curl --request POST \
--url https://api.vellaro.io/api/v1/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"address_line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>",
"company": "<string>",
"address_line2": "<string>",
"state": "<string>",
"phone": "<string>"
},
"billing_address": {
"first_name": "<string>",
"last_name": "<string>",
"address_line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>",
"company": "<string>",
"address_line2": "<string>",
"state": "<string>",
"phone": "<string>"
},
"coupon_code": "<string>",
"notes": "<string>",
"locale": "<string>",
"payment_method": "stripe",
"customer_email": "jsmith@example.com",
"subscribe_recurring_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"affiliate_code": "<string>"
}
'import requests
url = "https://api.vellaro.io/api/v1/checkout"
payload = {
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"address_line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>",
"company": "<string>",
"address_line2": "<string>",
"state": "<string>",
"phone": "<string>"
},
"billing_address": {
"first_name": "<string>",
"last_name": "<string>",
"address_line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>",
"company": "<string>",
"address_line2": "<string>",
"state": "<string>",
"phone": "<string>"
},
"coupon_code": "<string>",
"notes": "<string>",
"locale": "<string>",
"payment_method": "stripe",
"customer_email": "jsmith@example.com",
"subscribe_recurring_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"affiliate_code": "<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({
shipping_address: {
first_name: '<string>',
last_name: '<string>',
address_line1: '<string>',
city: '<string>',
postal_code: '<string>',
country: '<string>',
company: '<string>',
address_line2: '<string>',
state: '<string>',
phone: '<string>'
},
billing_address: {
first_name: '<string>',
last_name: '<string>',
address_line1: '<string>',
city: '<string>',
postal_code: '<string>',
country: '<string>',
company: '<string>',
address_line2: '<string>',
state: '<string>',
phone: '<string>'
},
coupon_code: '<string>',
notes: '<string>',
locale: '<string>',
payment_method: 'stripe',
customer_email: 'jsmith@example.com',
subscribe_recurring_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
affiliate_code: '<string>'
})
};
fetch('https://api.vellaro.io/api/v1/checkout', 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.vellaro.io/api/v1/checkout",
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([
'shipping_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'address_line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'country' => '<string>',
'company' => '<string>',
'address_line2' => '<string>',
'state' => '<string>',
'phone' => '<string>'
],
'billing_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'address_line1' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'country' => '<string>',
'company' => '<string>',
'address_line2' => '<string>',
'state' => '<string>',
'phone' => '<string>'
],
'coupon_code' => '<string>',
'notes' => '<string>',
'locale' => '<string>',
'payment_method' => 'stripe',
'customer_email' => 'jsmith@example.com',
'subscribe_recurring_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'affiliate_code' => '<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://api.vellaro.io/api/v1/checkout"
payload := strings.NewReader("{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"notes\": \"<string>\",\n \"locale\": \"<string>\",\n \"payment_method\": \"stripe\",\n \"customer_email\": \"jsmith@example.com\",\n \"subscribe_recurring_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"affiliate_code\": \"<string>\"\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.vellaro.io/api/v1/checkout")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"notes\": \"<string>\",\n \"locale\": \"<string>\",\n \"payment_method\": \"stripe\",\n \"customer_email\": \"jsmith@example.com\",\n \"subscribe_recurring_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"affiliate_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/checkout")
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 \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"company\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"state\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"notes\": \"<string>\",\n \"locale\": \"<string>\",\n \"payment_method\": \"stripe\",\n \"customer_email\": \"jsmith@example.com\",\n \"subscribe_recurring_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"affiliate_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_method": "<string>",
"subtotal": "<string>",
"shipping_cost": "<string>",
"tax": "<string>",
"discount_amount": "<string>",
"total": "<string>",
"currency": "<string>",
"client_secret": "<string>",
"stripe_publishable_key": "",
"paypal_order_id": "<string>",
"paypal_client_id": "<string>",
"pok_order_id": "<string>",
"pok_env": "<string>",
"paysera_redirect_url": "<string>",
"bank_details": {},
"tax_rate": "<string>",
"prices_include_tax": false
},
"meta": {
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
},
"error": "<string>",
"error_code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Autorizzazioni
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corpo
application/json
Payload sent by the client to initiate checkout.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I