Validate an order
curl --request POST \
--url https://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": {
"address1": "<string>",
"city": "<string>",
"countryCode": "<string>",
"phone": "<string>",
"address2": "",
"province": "<string>",
"provinceCode": "<string>",
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"zip": "",
"country": "<string>"
},
"companyId": "<string>",
"orderItems": [
{
"variantId": "<string>",
"quantity": 123
}
],
"taxNumber": "<string>",
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderNumber": "<string>",
"shouldValidateProvinceCode": true
}
'import requests
url = "https://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order"
payload = {
"address": {
"address1": "<string>",
"city": "<string>",
"countryCode": "<string>",
"phone": "<string>",
"address2": "",
"province": "<string>",
"provinceCode": "<string>",
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"zip": "",
"country": "<string>"
},
"companyId": "<string>",
"orderItems": [
{
"variantId": "<string>",
"quantity": 123
}
],
"taxNumber": "<string>",
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderNumber": "<string>",
"shouldValidateProvinceCode": True
}
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({
address: {
address1: '<string>',
city: '<string>',
countryCode: '<string>',
phone: '<string>',
address2: '',
province: '<string>',
provinceCode: '<string>',
customAttributes: [{key: '<string>', value: '<string>'}],
zip: '',
country: '<string>'
},
companyId: '<string>',
orderItems: [{variantId: '<string>', quantity: 123}],
taxNumber: '<string>',
customAttributes: [{key: '<string>', value: '<string>'}],
orderNumber: '<string>',
shouldValidateProvinceCode: true
})
};
fetch('https://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order', 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://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order",
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([
'address' => [
'address1' => '<string>',
'city' => '<string>',
'countryCode' => '<string>',
'phone' => '<string>',
'address2' => '',
'province' => '<string>',
'provinceCode' => '<string>',
'customAttributes' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'zip' => '',
'country' => '<string>'
],
'companyId' => '<string>',
'orderItems' => [
[
'variantId' => '<string>',
'quantity' => 123
]
],
'taxNumber' => '<string>',
'customAttributes' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'orderNumber' => '<string>',
'shouldValidateProvinceCode' => true
]),
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://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order"
payload := strings.NewReader("{\n \"address\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"address2\": \"\",\n \"province\": \"<string>\",\n \"provinceCode\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"zip\": \"\",\n \"country\": \"<string>\"\n },\n \"companyId\": \"<string>\",\n \"orderItems\": [\n {\n \"variantId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"taxNumber\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"orderNumber\": \"<string>\",\n \"shouldValidateProvinceCode\": true\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://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"address2\": \"\",\n \"province\": \"<string>\",\n \"provinceCode\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"zip\": \"\",\n \"country\": \"<string>\"\n },\n \"companyId\": \"<string>\",\n \"orderItems\": [\n {\n \"variantId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"taxNumber\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"orderNumber\": \"<string>\",\n \"shouldValidateProvinceCode\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order")
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 \"address\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"address2\": \"\",\n \"province\": \"<string>\",\n \"provinceCode\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"zip\": \"\",\n \"country\": \"<string>\"\n },\n \"companyId\": \"<string>\",\n \"orderItems\": [\n {\n \"variantId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"taxNumber\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"orderNumber\": \"<string>\",\n \"shouldValidateProvinceCode\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"message": "<string>",
"errorCode": "<string>",
"statusCode": 123,
"error": "<unknown>"
}{
"message": "<string>",
"errorCode": "<string>",
"statusCode": 123,
"error": "<unknown>"
}Orders
Validate an order
Validate an order
POST
/
api
/
ext
/
v1
/
collection
/
{collectionId}
/
orders
/
validate-order
Validate an order
curl --request POST \
--url https://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": {
"address1": "<string>",
"city": "<string>",
"countryCode": "<string>",
"phone": "<string>",
"address2": "",
"province": "<string>",
"provinceCode": "<string>",
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"zip": "",
"country": "<string>"
},
"companyId": "<string>",
"orderItems": [
{
"variantId": "<string>",
"quantity": 123
}
],
"taxNumber": "<string>",
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderNumber": "<string>",
"shouldValidateProvinceCode": true
}
'import requests
url = "https://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order"
payload = {
"address": {
"address1": "<string>",
"city": "<string>",
"countryCode": "<string>",
"phone": "<string>",
"address2": "",
"province": "<string>",
"provinceCode": "<string>",
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"zip": "",
"country": "<string>"
},
"companyId": "<string>",
"orderItems": [
{
"variantId": "<string>",
"quantity": 123
}
],
"taxNumber": "<string>",
"customAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"orderNumber": "<string>",
"shouldValidateProvinceCode": True
}
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({
address: {
address1: '<string>',
city: '<string>',
countryCode: '<string>',
phone: '<string>',
address2: '',
province: '<string>',
provinceCode: '<string>',
customAttributes: [{key: '<string>', value: '<string>'}],
zip: '',
country: '<string>'
},
companyId: '<string>',
orderItems: [{variantId: '<string>', quantity: 123}],
taxNumber: '<string>',
customAttributes: [{key: '<string>', value: '<string>'}],
orderNumber: '<string>',
shouldValidateProvinceCode: true
})
};
fetch('https://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order', 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://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order",
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([
'address' => [
'address1' => '<string>',
'city' => '<string>',
'countryCode' => '<string>',
'phone' => '<string>',
'address2' => '',
'province' => '<string>',
'provinceCode' => '<string>',
'customAttributes' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'zip' => '',
'country' => '<string>'
],
'companyId' => '<string>',
'orderItems' => [
[
'variantId' => '<string>',
'quantity' => 123
]
],
'taxNumber' => '<string>',
'customAttributes' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'orderNumber' => '<string>',
'shouldValidateProvinceCode' => true
]),
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://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order"
payload := strings.NewReader("{\n \"address\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"address2\": \"\",\n \"province\": \"<string>\",\n \"provinceCode\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"zip\": \"\",\n \"country\": \"<string>\"\n },\n \"companyId\": \"<string>\",\n \"orderItems\": [\n {\n \"variantId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"taxNumber\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"orderNumber\": \"<string>\",\n \"shouldValidateProvinceCode\": true\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://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"address2\": \"\",\n \"province\": \"<string>\",\n \"provinceCode\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"zip\": \"\",\n \"country\": \"<string>\"\n },\n \"companyId\": \"<string>\",\n \"orderItems\": [\n {\n \"variantId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"taxNumber\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"orderNumber\": \"<string>\",\n \"shouldValidateProvinceCode\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-api.covver.io/api/ext/v1/collection/{collectionId}/orders/validate-order")
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 \"address\": {\n \"address1\": \"<string>\",\n \"city\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"address2\": \"\",\n \"province\": \"<string>\",\n \"provinceCode\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"zip\": \"\",\n \"country\": \"<string>\"\n },\n \"companyId\": \"<string>\",\n \"orderItems\": [\n {\n \"variantId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"taxNumber\": \"<string>\",\n \"customAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"orderNumber\": \"<string>\",\n \"shouldValidateProvinceCode\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"message": "<string>",
"errorCode": "<string>",
"statusCode": 123,
"error": "<unknown>"
}{
"message": "<string>",
"errorCode": "<string>",
"statusCode": 123,
"error": "<unknown>"
}This endpoint validates
For Mexico the pattern is 13 characters (4 letters followed by 6 digits and 3 alphanumeric characters).
For China, Italy, and South Korea there is no validation run on the taxNumber field.
- The province is correct for the provided country
- The variants can be shipped to the provided country
- The phone number is valid
- The zip code is valid
- The taxNumber field
- It is supposed to be there for the provided country
- It is formatted correctly and passes regex validation
Partners must pass in the companyId field in the body
Tax number
For Brazil, Mexico, China, Italy, and South Korea you must pass in an additional taxNumber field. For Brazil the tax number field must pass regex validation as followsnew RegExp(`^\\d{3}\\.\\d{3}\\.\\d{3}-\\d{2}$`).test(taxNumber)
new RegExp(`^[A-Za-z]{4}\\d{6}[A-Za-z0-9]{3}$`).test(taxNumber)
CustomAttributes
Custom attribute field is deprecated. Please use the taxNumber field insteadAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
object | null
Default Response
⌘I

