Orders
Validate an order
Validate an order
POST
/
api
/
ext
/
v1
/
collection
/
{collectionId}
/
orders
/
validate-order
This endpoint validates
- 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
This endpoint does not currently check the validity of the address itself.
Phone number validation is done with libphonenumber-js.
Here is a demo page of the phone validation for further testing.
Tax number
For Brazil, China, Italy, and South Korea you must pass in an additional taxNumber field. For Brazil the tax number field must pass regex validation as follows
new RegExp(`^\\d{3}\\.\\d{3}\\.\\d{3}-\\d{2}$`).test(taxNumber)
For China, Italy, and South Korea there is no validation run on the taxNumber field.
CustomAttributes
Custom attribute field is deprecated. Please use the taxNumber field instead
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
collectionId
string
requiredBody
application/json
companyId
string
orderItems
object[]
taxNumber
string
customAttributes
object[]
orderNumber
string
address
object
requiredshouldValidateProvinceCode
boolean
Response
200 - application/json
success
boolean
required