As part of the integration process, we may ask for a schema for your Quote API.
A schema provides metadata for API responses. It provides structured information that will allow our engineers to easily integrate the API into our existing systems. We will use the schemas to understand what operations can be performed and what structure we can expect from the responses.
An API schema includes:
-
The structure of elements within the API response
-
The data type for each response element
Depending on the API type, you will need to provide either a JSON or an XSD schema.
JSON Schema
For specific information on JSON schemas, please visit the official documentation. Refer below for the example schema for this simple API response.
Response example
{
"checked": false,
"dimensions": {
"width": 5,
"height": 10
},
"name": "A green door",
"price": 12.5,
"tags": [
"home",
"green"
]
}
Schema example
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"default": {},
"title": "Root Schema",
"required": [
"checked",
"dimensions",
"name",
"price",
"tags"
],
"properties": {
"checked": {
"type": "boolean",
"default": false,
"title": "The checked Schema",
"examples": [
false
]
},
"dimensions": {
"type": "object",
"default": {},
"title": "The dimensions Schema",
"required": [
"width",
"height"
],
"properties": {
"width": {
"type": "integer",
"default": 0,
"title": "The width Schema",
"examples": [
5
]
},
"height": {
"type": "integer",
"default": 0,
"title": "The height Schema",
"examples": [
10
]
}
},
"examples": [
{
"width": 5,
"height": 10
}
]
},
"name": {
"type": "string",
"default": "",
"title": "The name Schema",
"examples": [
"A green door"
]
},
"price": {
"type": "number",
"default": 0,
"title": "The price Schema",
"examples": [
12.5
]
},
"tags": {
"type": "array",
"default": [],
"title": "The tags Schema",
"items": {
"type": "string",
"title": "A Schema",
"examples": [
"home",
"green"
]
},
"examples": [
[
"home",
"green"
]
]
}
},
"examples": [
{
"checked": false,
"dimensions": {
"width": 5,
"height": 10
},
"name": "A green door",
"price": 12.5,
"tags": [
"home",
"green"
]
}
]
}
Comments
0 comments
Article is closed for comments.