cURL
curl --request POST \
--url https://api-v2.vitau.mx/api/orders/calculate/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"details": [
{
"product": 123,
"quantity": 16383
}
],
"zipcode": "<string>",
"coupon": "<string>",
"store": 123
}
'import requests
url = "https://api-v2.vitau.mx/api/orders/calculate/"
payload = {
"details": [
{
"product": 123,
"quantity": 16383
}
],
"zipcode": "<string>",
"coupon": "<string>",
"store": 123
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
details: [{product: 123, quantity: 16383}],
zipcode: '<string>',
coupon: '<string>',
store: 123
})
};
fetch('https://api-v2.vitau.mx/api/orders/calculate/', 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-v2.vitau.mx/api/orders/calculate/",
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([
'details' => [
[
'product' => 123,
'quantity' => 16383
]
],
'zipcode' => '<string>',
'coupon' => '<string>',
'store' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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-v2.vitau.mx/api/orders/calculate/"
payload := strings.NewReader("{\n \"details\": [\n {\n \"product\": 123,\n \"quantity\": 16383\n }\n ],\n \"zipcode\": \"<string>\",\n \"coupon\": \"<string>\",\n \"store\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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-v2.vitau.mx/api/orders/calculate/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"details\": [\n {\n \"product\": 123,\n \"quantity\": 16383\n }\n ],\n \"zipcode\": \"<string>\",\n \"coupon\": \"<string>\",\n \"store\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.vitau.mx/api/orders/calculate/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"details\": [\n {\n \"product\": 123,\n \"quantity\": 16383\n }\n ],\n \"zipcode\": \"<string>\",\n \"coupon\": \"<string>\",\n \"store\": 123\n}"
response = http.request(request)
puts response.read_body{
"details": [
{
"product": 123,
"quantity": 16383,
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"price": "<string>",
"subtotal": "<string>",
"total": "<string>",
"discount": "<string>",
"iva": "<string>",
"order": 123
}
],
"patient": 123,
"payment_method": 123,
"id": 123,
"shipping": 123,
"store": 123,
"payment": 123,
"paypal_agreement": 123,
"invoicing": 123,
"coupon": "<string>",
"shipping_method": 123,
"prescriptions": [
{
"document": "<string>",
"issue_date": "2023-12-25",
"id": 123,
"document_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expiring_date": "2023-12-25",
"is_verified": true,
"patient": 123,
"order": 123,
"updated_by": 123
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"insurance_refund_status": "not_started",
"order_status": "quoted",
"payment_status": "unpaid",
"rejection_reason": "<string>",
"origin": "<string>",
"subtotal": "<string>",
"iva": "<string>",
"shipping_price": "<string>",
"shipping_discount": "<string>",
"shipping_cost": "<string>",
"discount": "<string>",
"total": "<string>",
"payment_date": "2023-11-07T05:31:56Z",
"shipping_date": "2023-11-07T05:31:56Z",
"expected_delivery_date": "2023-11-07T05:31:56Z",
"max_delivery_date": "2023-11-07T05:31:56Z",
"receiving_date": "2023-11-07T05:31:56Z",
"folio": "<string>",
"cfdi": "<string>",
"external_payment_id": "<string>",
"generated_by": 123,
"updated_by": 123,
"reminder": 123,
"subscription": 123
}API Reference
Post Calculate Order
POST
/
api
/
orders
/
calculate
/
cURL
curl --request POST \
--url https://api-v2.vitau.mx/api/orders/calculate/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"details": [
{
"product": 123,
"quantity": 16383
}
],
"zipcode": "<string>",
"coupon": "<string>",
"store": 123
}
'import requests
url = "https://api-v2.vitau.mx/api/orders/calculate/"
payload = {
"details": [
{
"product": 123,
"quantity": 16383
}
],
"zipcode": "<string>",
"coupon": "<string>",
"store": 123
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
details: [{product: 123, quantity: 16383}],
zipcode: '<string>',
coupon: '<string>',
store: 123
})
};
fetch('https://api-v2.vitau.mx/api/orders/calculate/', 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-v2.vitau.mx/api/orders/calculate/",
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([
'details' => [
[
'product' => 123,
'quantity' => 16383
]
],
'zipcode' => '<string>',
'coupon' => '<string>',
'store' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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-v2.vitau.mx/api/orders/calculate/"
payload := strings.NewReader("{\n \"details\": [\n {\n \"product\": 123,\n \"quantity\": 16383\n }\n ],\n \"zipcode\": \"<string>\",\n \"coupon\": \"<string>\",\n \"store\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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-v2.vitau.mx/api/orders/calculate/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"details\": [\n {\n \"product\": 123,\n \"quantity\": 16383\n }\n ],\n \"zipcode\": \"<string>\",\n \"coupon\": \"<string>\",\n \"store\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.vitau.mx/api/orders/calculate/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"details\": [\n {\n \"product\": 123,\n \"quantity\": 16383\n }\n ],\n \"zipcode\": \"<string>\",\n \"coupon\": \"<string>\",\n \"store\": 123\n}"
response = http.request(request)
puts response.read_body{
"details": [
{
"product": 123,
"quantity": 16383,
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"price": "<string>",
"subtotal": "<string>",
"total": "<string>",
"discount": "<string>",
"iva": "<string>",
"order": 123
}
],
"patient": 123,
"payment_method": 123,
"id": 123,
"shipping": 123,
"store": 123,
"payment": 123,
"paypal_agreement": 123,
"invoicing": 123,
"coupon": "<string>",
"shipping_method": 123,
"prescriptions": [
{
"document": "<string>",
"issue_date": "2023-12-25",
"id": 123,
"document_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expiring_date": "2023-12-25",
"is_verified": true,
"patient": 123,
"order": 123,
"updated_by": 123
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"insurance_refund_status": "not_started",
"order_status": "quoted",
"payment_status": "unpaid",
"rejection_reason": "<string>",
"origin": "<string>",
"subtotal": "<string>",
"iva": "<string>",
"shipping_price": "<string>",
"shipping_discount": "<string>",
"shipping_cost": "<string>",
"discount": "<string>",
"total": "<string>",
"payment_date": "2023-11-07T05:31:56Z",
"shipping_date": "2023-11-07T05:31:56Z",
"expected_delivery_date": "2023-11-07T05:31:56Z",
"max_delivery_date": "2023-11-07T05:31:56Z",
"receiving_date": "2023-11-07T05:31:56Z",
"folio": "<string>",
"cfdi": "<string>",
"external_payment_id": "<string>",
"generated_by": 123,
"updated_by": 123,
"reminder": 123,
"subscription": 123
}Authorizations
APIKeyAuthJWTAuthCookieAuth
Body
application/json
Response
201 - application/json
Show child attributes
Show child attributes
Required string length:
1 - 16Show child attributes
Show child attributes
Available options:
not_started, missing_data, sent_to_broker, sent_to_insurer, approved_by_insurer Available options:
quoted, pending_approval, approved, in_process, ready, shipped, delivered, cancelled, delayed, shortage Available options:
unpaid, credit, paid, in_process, processing, rejected Minimum string length:
1Maximum string length:
20Maximum string length:
20Minimum string length:
1Minimum string length:
1Was this page helpful?