From 89e2ca546844900554e000a7f427a244ee6ac6b1 Mon Sep 17 00:00:00 2001 From: Brendan Abbott Date: Fri, 26 May 2017 14:17:07 +1000 Subject: [PATCH] Support 'type' being an array. Closes #36 --- src/components/BodySchema/BodySchema.js | 2 +- src/components/Description/Description.js | 7 +- src/components/Property/Property.js | 19 +- src/parser/open-api/schemaParser.js | 21 +- src/parser/open-api/v3/open-api-v3-parser.js | 7 +- test/components/Description.test.js | 4 +- test/components/Property.test.js | 62 + .../__snapshots__/Property.test.js.snap | 148 + .../data/schemaParser/complexInputSchema.json | 33 + .../schemaParser/complexOutputSchema.json | 35 + .../data/schemaParser/outputSchema.json | 48 +- test/parser/open-api/schemaParser.test.js | 7 + .../open-api/v3/data/inputs/shipping.json | 2389 ------- .../open-api/v3/data/outputs/accounts.json | 320 +- .../open-api/v3/data/outputs/carrier.json | 116 +- .../open-api/v3/data/outputs/shipping.json | 5892 ----------------- 16 files changed, 683 insertions(+), 8427 deletions(-) create mode 100644 test/components/Property.test.js create mode 100644 test/components/__snapshots__/Property.test.js.snap create mode 100644 test/parser/open-api/data/schemaParser/complexInputSchema.json create mode 100644 test/parser/open-api/data/schemaParser/complexOutputSchema.json delete mode 100644 test/parser/open-api/v3/data/inputs/shipping.json delete mode 100644 test/parser/open-api/v3/data/outputs/shipping.json diff --git a/src/components/BodySchema/BodySchema.js b/src/components/BodySchema/BodySchema.js index 385a033..81f0c04 100644 --- a/src/components/BodySchema/BodySchema.js +++ b/src/components/BodySchema/BodySchema.js @@ -69,10 +69,10 @@ export default class BodySchema extends Component { type={property.type} subtype={property.subtype} description={property.description} - required={property.required} enumValues={property.enum} defaultValue={property.defaultValue} onClick={this.onClick.bind(this, property.name)} + isRequired={property.required} isOpen={isOpen} isLast={isLast} /> diff --git a/src/components/Description/Description.js b/src/components/Description/Description.js index cdee9ef..3e847c3 100644 --- a/src/components/Description/Description.js +++ b/src/components/Description/Description.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import classNames from 'classnames'; import markdown from 'markdown-it'; +import PropTypes from 'prop-types'; const cm = markdown('commonmark'); @@ -14,7 +15,9 @@ export default class Description extends Component { }; return ( -
+
); } } diff --git a/src/components/Property/Property.js b/src/components/Property/Property.js index 4cd4e7b..6d9a22f 100644 --- a/src/components/Property/Property.js +++ b/src/components/Property/Property.js @@ -9,10 +9,10 @@ import './Property.scss'; export default class Property extends Component { render() { - const { name, type, description, required, enumValues, defaultValue, onClick, isOpen, isLast } = this.props; + const { name, type, description, isRequired, enumValues, defaultValue, onClick, isOpen, isLast } = this.props; let subtype; - if (type === 'array') { + if (type.includes('array')) { subtype = this.props.subtype; } @@ -24,6 +24,7 @@ export default class Property extends Component { if (isOpen) { status = 'open'; } + return ( - {type}{subtype && of {subtype}} - {required && Required} + {type.join(', ')}{subtype && of {subtype}} + {isRequired && Required} {enumValues && this.renderEnumValues(enumValues)} {defaultValue && this.renderDefaultValue(defaultValue)} {description && } @@ -89,14 +90,14 @@ export default class Property extends Component { } Property.propTypes = { - name: PropTypes.string, - type: PropTypes.string, + name: PropTypes.string.isRequired, + type: PropTypes.arrayOf(PropTypes.string).isRequired, subtype: PropTypes.string, description: PropTypes.string, - required: PropTypes.bool, enumValues: PropTypes.array, defaultValue: PropTypes.any, - onClick: PropTypes.func, + isRequired: PropTypes.bool, isOpen: PropTypes.bool, - isLast: PropTypes.bool + isLast: PropTypes.bool, + onClick: PropTypes.func }; diff --git a/src/parser/open-api/schemaParser.js b/src/parser/open-api/schemaParser.js index 11e4d55..00d203d 100644 --- a/src/parser/open-api/schemaParser.js +++ b/src/parser/open-api/schemaParser.js @@ -3,7 +3,7 @@ import { resolveAllOf } from './allOfResolver'; const literalTypes = ['string', 'integer', 'number', 'boolean']; /** - * Construct UI ready property object from given inputs + * Construct UI ready property object from given inputs. * * @param {String} nodeName * @param {Object} propertyNode @@ -12,7 +12,11 @@ const literalTypes = ['string', 'integer', 'number', 'boolean']; * @return {Object} */ function getPropertyNode(nodeName, propertyNode, required = false) { - const nodeType = propertyNode.type || 'string'; + let nodeType = propertyNode.type || 'string'; + + if (!Array.isArray(nodeType)) { + nodeType = [ nodeType ]; + } const outputNode = { name: nodeName, @@ -28,15 +32,16 @@ function getPropertyNode(nodeName, propertyNode, required = false) { outputNode.defaultValue = propertyNode.default; } - if (literalTypes.indexOf(nodeType) >= 0) { - // Literal types + // Are all the possible types for this property literals? + // TODO: Currently do not handle multiple types that are not all literals + if (nodeType.every((type) => literalTypes.includes(type))) { if (propertyNode.enum) { outputNode.enum = propertyNode.enum; } return outputNode; - } else if (nodeType === 'object') { - // Object type + // Otherwise, let's see if there's an object in there.. + } else if (nodeType.length === 1 && nodeType.includes('object')) { const propertiesNode = getPropertiesNode(propertyNode.properties, propertyNode.required); if (propertiesNode !== undefined && propertiesNode.length > 0) { @@ -44,8 +49,8 @@ function getPropertyNode(nodeName, propertyNode, required = false) { } return outputNode; - } else if (nodeType === 'array') { - // Array type + // Is there an array? + } else if (nodeType.length === 1 && nodeType.includes('array')) { if (propertyNode.items) { const arrayItemType = propertyNode.items.type; diff --git a/src/parser/open-api/v3/open-api-v3-parser.js b/src/parser/open-api/v3/open-api-v3-parser.js index b973523..10b7083 100644 --- a/src/parser/open-api/v3/open-api-v3-parser.js +++ b/src/parser/open-api/v3/open-api-v3-parser.js @@ -147,10 +147,13 @@ function getUIParametersForLocation(parameters, location) { required: parameter.required }; + // TODO: We set the type to be an array because the Property component + // handles this. Property should eventually be split and this won't be + // necessary... if (parameter.type) { - uiParameter.type = parameter.type; + uiParameter.type = [ parameter.type ]; } else if (parameter.schema && parameter.schema.type) { - uiParameter.type = parameter.schema.type; + uiParameter.type = [ parameter.schema.type ]; } if (parameter.schema && parameter.schema.default !== undefined) { diff --git a/test/components/Description.test.js b/test/components/Description.test.js index d774a39..318f804 100644 --- a/test/components/Description.test.js +++ b/test/components/Description.test.js @@ -7,7 +7,7 @@ describe('', () => { const text = 'This method has zero markdown.'; const tree = renderer.create( - ).toJSON(); + ); expect(tree).toMatchSnapshot(); }); @@ -16,7 +16,7 @@ describe('', () => { const text = 'This method has some `var i = 0` _markdown_, including a [link](http://www.google.com).'; const tree = renderer.create( - ).toJSON(); + ); expect(tree).toMatchSnapshot(); }); diff --git a/test/components/Property.test.js b/test/components/Property.test.js new file mode 100644 index 0000000..711591e --- /dev/null +++ b/test/components/Property.test.js @@ -0,0 +1,62 @@ +import React from 'react'; +import Property from './../../src/components/Property/Property'; +import renderer from 'react-test-renderer'; +import ReactShallowRenderer from 'react-test-renderer/shallow'; + +describe('', () => { + it('can render a basic property', () => { + const tree = renderer.create( + + ); + + expect(tree).toMatchSnapshot(); + }); + + it('can render a property with enum', () => { + const tree = renderer.create( + + ); + + expect(tree).toMatchSnapshot(); + }); + + it('can render a property with a subtype', () => { + const tree = renderer.create( + + ); + + expect(tree).toMatchSnapshot(); + }); + + it('can render a property with description', () => { + const shallow = new ReactShallowRenderer(); + const tree = shallow.render( + + ); + + expect(tree).toMatchSnapshot(); + }); + + it('can render a property with multiple types', () => { + const tree = renderer.create( + + ); + + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/test/components/__snapshots__/Property.test.js.snap b/test/components/__snapshots__/Property.test.js.snap new file mode 100644 index 0000000..468c6aa --- /dev/null +++ b/test/components/__snapshots__/Property.test.js.snap @@ -0,0 +1,148 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` can render a basic property 1`] = ` + + + + type + + + + + string + + + Required + + + +`; + +exports[` can render a property with a subtype 1`] = ` + + + + data + + + + + array + + + of + object + + + +`; + +exports[` can render a property with description 1`] = ` + + + + type + + + + + string + + + Required + + + + +`; + +exports[` can render a property with enum 1`] = ` + + + + packagingType + + + + + string + + + Required + +
+ + Valid values: + + + box + + + carton + +
+ + +`; + +exports[` can render a property with multiple types 1`] = ` + + + + value + + + + + string, number + + + +`; diff --git a/test/parser/open-api/data/schemaParser/complexInputSchema.json b/test/parser/open-api/data/schemaParser/complexInputSchema.json new file mode 100644 index 0000000..88e6362 --- /dev/null +++ b/test/parser/open-api/data/schemaParser/complexInputSchema.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "customAttributes": { + "additionalProperties": false, + "type": "array", + "items": { + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+$" + }, + "value": { + "type": [ + "number", + "integer", + "string", + "boolean" + ] + } + } + } + } + } +} diff --git a/test/parser/open-api/data/schemaParser/complexOutputSchema.json b/test/parser/open-api/data/schemaParser/complexOutputSchema.json new file mode 100644 index 0000000..e626027 --- /dev/null +++ b/test/parser/open-api/data/schemaParser/complexOutputSchema.json @@ -0,0 +1,35 @@ +[ + { + "name": "name", + "required": false, + "type": [ + "string" + ] + }, + { + "name": "customAttributes", + "required": false, + "type": [ + "array" + ], + "properties": [ + { + "name": "key", + "required": true, + "type": [ + "string" + ] + }, + { + "name": "value", + "required": true, + "type": [ + "number", + "integer", + "string", + "boolean" + ] + } + ] + } +] diff --git a/test/parser/open-api/data/schemaParser/outputSchema.json b/test/parser/open-api/data/schemaParser/outputSchema.json index 520953d..b62e727 100644 --- a/test/parser/open-api/data/schemaParser/outputSchema.json +++ b/test/parser/open-api/data/schemaParser/outputSchema.json @@ -5,7 +5,9 @@ { "name": "type", "required": true, - "type": "string", + "type": [ + "string" + ], "enum": [ "account" ] @@ -17,13 +19,17 @@ "description": "Pre-generated Invitation code", "name": "invitationCode", "required": true, - "type": "string" + "type": [ + "string" + ] }, { "description": "One of predefined platforms", "name": "platform", "required": true, - "type": "string", + "type": [ + "string" + ], "enum": [ "test", "custom", @@ -34,25 +40,33 @@ "description": "Name, eg: Company name", "name": "name", "required": true, - "type": "string" + "type": [ + "string" + ] }, { "description": "Email of the default user", "name": "email", "required": true, - "type": "string" + "type": [ + "string" + ] }, { "description": "User password", "name": "password", "required": false, - "type": "string" + "type": [ + "string" + ] }, { "description": "IP address where the request came from", "name": "ipAddress", "required": true, - "type": "string" + "type": [ + "string" + ] }, { "description": "This is the schema for representing addresses.", @@ -62,25 +76,35 @@ "description": "Lines of the address", "name": "line", "required": false, - "type": "array", + "type": [ + "array" + ], "subtype": "string" }, { "description": "The post or zip code of this address.", "name": "postalCode", "required": false, - "type": "string" + "type": [ + "string" + ] } ], "required": false, - "type": "object" + "type": [ + "object" + ] } ], "required": true, - "type": "object" + "type": [ + "object" + ] } ], "required": true, - "type": "object" + "type": [ + "object" + ] } ] diff --git a/test/parser/open-api/schemaParser.test.js b/test/parser/open-api/schemaParser.test.js index 858684c..96e91dc 100644 --- a/test/parser/open-api/schemaParser.test.js +++ b/test/parser/open-api/schemaParser.test.js @@ -2,10 +2,17 @@ import getUIReadySchema from '../../../src/parser/open-api/schemaParser'; import inputSchema from './data/schemaParser/inputSchema.json'; import expectedOutputSchema from './data/schemaParser/outputSchema.json'; +import complexInputSchema from './data/schemaParser/complexInputSchema.json'; +import complexExpectedOutputSchema from './data/schemaParser/complexOutputSchema.json'; describe('getUIReadySchema', () => { it('returns the correct result', () => { const outputSchema = getUIReadySchema(inputSchema); expect(outputSchema).toEqual(expectedOutputSchema); }); + + it('returns the correct result', () => { + const outputSchema = getUIReadySchema(complexInputSchema); + expect(outputSchema).toEqual(complexExpectedOutputSchema); + }); }); diff --git a/test/parser/open-api/v3/data/inputs/shipping.json b/test/parser/open-api/v3/data/inputs/shipping.json deleted file mode 100644 index f30acb4..0000000 --- a/test/parser/open-api/v3/data/inputs/shipping.json +++ /dev/null @@ -1,2389 +0,0 @@ -{ - "openapi": "3.0.0-RC0", - "servers": [ - { - "url": "https://api.temando.io/v1" - } - ], - "info": { - "title": "Temando API", - "description": "Providing consumers with more choice and lowering the cost of shipping.", - "version": "1.0.0" - }, - "paths": { - "/products": { - "post": { - "summary": "Create a Product object in the account.", - "description": "Create a Product object in the account.", - "tags": [ - "Product" - ], - "parameters": [], - "responses": { - "201": { - "description": "Newly created Product with unique ID.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/StoredProductSingle" - } - } - } - }, - "422": { - "description": "The request schema did not meet the specification.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/JsonApiError" - } - } - } - } - }, - "requestBody": { - "content": { - "application/vnd.api+json": { - "description": "Request for creating product object.", - "schema": { - "$ref": "#/components/schemas/Product" - } - } - } - } - }, - "get": { - "summary": "Get list of Products in the account document.", - "description": "Get list of Products in the account document.", - "tags": [ - "Product" - ], - "parameters": [ - { - "name": "offset", - "in": "query", - "description": "Offset for the returned array of records", - "required": false, - "schema": { - "type": "number" - } - }, - { - "name": "limit", - "in": "query", - "description": "Limit for the returned array of records.", - "required": false, - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "List of all of the Products defined.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/StoredProductCollection" - } - } - } - }, - "422": { - "description": "The request schema did not meet the specification.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/JsonApiError" - } - } - } - } - } - } - }, - "/products/{id}": { - "get": { - "summary": "Get Product from account document.", - "description": "Get Product from account document.", - "tags": [ - "Product" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "id of Product to fetch", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Return the Product specified by ID parameter", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/StoredProductSingle" - } - } - } - }, - "404": { - "description": "The resource could not be found.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/JsonApiError" - } - } - } - }, - "422": { - "description": "The request schema did not meet the specification.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/JsonApiError" - } - } - } - } - } - }, - "put": { - "summary": "Update Product.", - "description": "Update Product in account document.", - "tags": [ - "Product" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "id of Product to update", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the Product.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/StoredProductSingle" - } - } - } - }, - "404": { - "description": "The resource could not be found.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/JsonApiError" - } - } - } - }, - "422": { - "description": "The request schema did not meet the specification.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/JsonApiError" - } - } - } - } - }, - "requestBody": { - "content": { - "application/vnd.api+json": { - "description": "The new data to store against the Product", - "schema": { - "$ref": "#/components/schemas/StoredProductSingle" - } - } - } - } - }, - "delete": { - "summary": "Remove Products.", - "description": "Remove Product from account document.", - "tags": [ - "Product" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "id of Product to remove", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "204": { - "description": "Successfully deleted the Product." - }, - "404": { - "description": "The resource could not be found.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/JsonApiError" - } - } - } - }, - "422": { - "description": "The request schema did not meet the specification.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/JsonApiError" - } - } - } - } - } - } - }, - "/shipments/{id}": { - "get": { - "summary": "Get shipment from account document by id.", - "tags": [ - "Shipment" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "id of shipment to fetch", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Return the shipment specified by id parameter", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/StoredShipment" - } - } - } - }, - "400": { - "description": "Bad Request.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "401": { - "description": "Authentication failed.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not Found.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "500": { - "description": "Unexpected error.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - }, - "put": { - "summary": "Update Shipment.", - "description": "Update Shipment in account document.", - "tags": [ - "Shipment" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "id of Shipment to update", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the Shipment.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/StoredShipment" - } - } - } - }, - "401": { - "description": "Authentication failed.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "403": { - "description": "Expired credentials.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "422": { - "description": "The request schema did not meet the specification.", - "content": { - "application/vnd.api+json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "requestBody": { - "content": { - "application/vnd.api+json": { - "description": "The new data to store against the Shipment", - "schema": { - "$ref": "#/components/schemas/StoredShipment" - } - } - } - } - } - } - }, - "components": { - "schemas": { - "JsonApiError": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "status": { - "type": "string" - }, - "title": { - "type": "string" - }, - "detail": { - "type": "string" - }, - "meta": { - "type": "object" - }, - "code": { - "type": "string" - }, - "links": { - "type": "object" - }, - "source": { - "type": "object" - } - } - }, - "Product": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "product" - ] - }, - "attributes": { - "description": "This is the schema for representing product's attributes.", - "type": "object", - "required": [ - "merchantProductId", - "name" - ], - "properties": { - "merchantProductId": { - "description": "The product unique identifier, provided by the merchant", - "type": "string", - "maxLength": 100 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "sku": { - "type": "string", - "description": "The sku of this product.", - "maxLength": 100 - }, - "description": { - "type": "string", - "description": "The description of this product.", - "maxLength": 500 - }, - "category": { - "type": "string", - "description": "The category of this product." - }, - "unitOfMeasure": { - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "type": "string", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - "dimensions": { - "description": "This is the schema for representing dimensions", - "type": "object", - "additionalProperties": false, - "required": [ - "length", - "width", - "height", - "unitOfMeasurement" - ], - "properties": { - "length": { - "type": "number" - }, - "width": { - "type": "number" - }, - "height": { - "type": "number" - }, - "unitOfMeasurement": { - "description": "The distance unit the dimension's properties are in", - "type": "string", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - } - }, - "weight": { - "type": "object", - "required": [ - "value", - "unitOfMeasurement" - ], - "properties": { - "value": { - "description": "The value of the weight unit", - "type": "number" - }, - "unitOfMeasurement": { - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - } - }, - "monetaryValue": { - "description": "This is the schema for an representing money", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "description": "The amount of the currency", - "type": "number" - }, - "currency": { - "description": "The currency the money amount is", - "type": "string", - "maxLength": 3, - "minLength": 3 - } - } - }, - "isFragile": { - "type": "boolean", - "default": false - }, - "isVirtual": { - "type": "boolean", - "default": false - }, - "isPrePackaged": { - "description": "Whether the product has its own package", - "type": "boolean", - "default": false - }, - "canRotateVertical": { - "description": "Whether the product can be rotated vertically", - "type": "boolean", - "default": true - }, - "countryOfOrigin": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "countryOfManufacture": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "classificationCodes": { - "type": "object", - "description": "Classification codes of this product for export.", - "properties": { - "eccn": { - "type": "string", - "description": "Export Control Classification Number (ECCN).", - "minLength": 0, - "maxLength": 5 - }, - "scheduleBinfo": { - "type": "string", - "description": "Classification code for exporting goods out of the United States.", - "minLength": 0, - "maxLength": 15 - }, - "hsCode": { - "type": "string", - "description": "Harmonized Commodity Description and Coding System.", - "minLength": 2, - "maxLength": 10 - } - } - }, - "customAttributes": { - "default": [], - "type": "array", - "items": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "pattern": "^[a-zA-Z0-9_-]+$" - }, - "value": { - "type": [ - "number", - "integer", - "string", - "boolean" - ] - } - }, - "additionalProperties": false - } - } - } - } - } - } - } - }, - "StoredProductCollection": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "attributes", - "id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "product" - ] - }, - "id": { - "description": "GUID of the object.", - "type": "string" - }, - "attributes": { - "description": "This is the schema for representing product's attributes.", - "type": "object", - "required": [ - "merchantProductId", - "name" - ], - "properties": { - "merchantProductId": { - "description": "The product unique identifier, provided by the merchant", - "type": "string", - "maxLength": 100 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "sku": { - "type": "string", - "description": "The sku of this product.", - "maxLength": 100 - }, - "description": { - "type": "string", - "description": "The description of this product.", - "maxLength": 500 - }, - "category": { - "type": "string", - "description": "The category of this product." - }, - "unitOfMeasure": { - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "type": "string", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - "dimensions": { - "description": "This is the schema for representing dimensions", - "type": "object", - "additionalProperties": false, - "required": [ - "length", - "width", - "height", - "unitOfMeasurement" - ], - "properties": { - "length": { - "type": "number" - }, - "width": { - "type": "number" - }, - "height": { - "type": "number" - }, - "unitOfMeasurement": { - "description": "The distance unit the dimension's properties are in", - "type": "string", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - } - }, - "weight": { - "type": "object", - "required": [ - "value", - "unitOfMeasurement" - ], - "properties": { - "value": { - "description": "The value of the weight unit", - "type": "number" - }, - "unitOfMeasurement": { - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - } - }, - "monetaryValue": { - "description": "This is the schema for an representing money", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "description": "The amount of the currency", - "type": "number" - }, - "currency": { - "description": "The currency the money amount is", - "type": "string", - "maxLength": 3, - "minLength": 3 - } - } - }, - "isFragile": { - "type": "boolean", - "default": false - }, - "isVirtual": { - "type": "boolean", - "default": false - }, - "isPrePackaged": { - "description": "Whether the product has its own package", - "type": "boolean", - "default": false - }, - "canRotateVertical": { - "description": "Whether the product can be rotated vertically", - "type": "boolean", - "default": true - }, - "countryOfOrigin": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "countryOfManufacture": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "classificationCodes": { - "type": "object", - "description": "Classification codes of this product for export.", - "properties": { - "eccn": { - "type": "string", - "description": "Export Control Classification Number (ECCN).", - "minLength": 0, - "maxLength": 5 - }, - "scheduleBinfo": { - "type": "string", - "description": "Classification code for exporting goods out of the United States.", - "minLength": 0, - "maxLength": 15 - }, - "hsCode": { - "type": "string", - "description": "Harmonized Commodity Description and Coding System.", - "minLength": 2, - "maxLength": 10 - } - } - }, - "customAttributes": { - "default": [], - "type": "array", - "items": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "pattern": "^[a-zA-Z0-9_-]+$" - }, - "value": { - "type": [ - "number", - "integer", - "string", - "boolean" - ] - } - }, - "additionalProperties": false - } - } - } - } - } - } - } - } - }, - "StoredProductSingle": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes", - "id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "product" - ] - }, - "id": { - "description": "GUID of the object.", - "type": "string" - }, - "attributes": { - "description": "This is the schema for representing product's attributes.", - "type": "object", - "required": [ - "merchantProductId", - "name" - ], - "properties": { - "merchantProductId": { - "description": "The product unique identifier, provided by the merchant", - "type": "string", - "maxLength": 100 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "sku": { - "type": "string", - "description": "The sku of this product.", - "maxLength": 100 - }, - "description": { - "type": "string", - "description": "The description of this product.", - "maxLength": 500 - }, - "category": { - "type": "string", - "description": "The category of this product." - }, - "unitOfMeasure": { - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "type": "string", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - "dimensions": { - "description": "This is the schema for representing dimensions", - "type": "object", - "additionalProperties": false, - "required": [ - "length", - "width", - "height", - "unitOfMeasurement" - ], - "properties": { - "length": { - "type": "number" - }, - "width": { - "type": "number" - }, - "height": { - "type": "number" - }, - "unitOfMeasurement": { - "description": "The distance unit the dimension's properties are in", - "type": "string", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - } - }, - "weight": { - "type": "object", - "required": [ - "value", - "unitOfMeasurement" - ], - "properties": { - "value": { - "description": "The value of the weight unit", - "type": "number" - }, - "unitOfMeasurement": { - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - } - }, - "monetaryValue": { - "description": "This is the schema for an representing money", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "description": "The amount of the currency", - "type": "number" - }, - "currency": { - "description": "The currency the money amount is", - "type": "string", - "maxLength": 3, - "minLength": 3 - } - } - }, - "isFragile": { - "type": "boolean", - "default": false - }, - "isVirtual": { - "type": "boolean", - "default": false - }, - "isPrePackaged": { - "description": "Whether the product has its own package", - "type": "boolean", - "default": false - }, - "canRotateVertical": { - "description": "Whether the product can be rotated vertically", - "type": "boolean", - "default": true - }, - "countryOfOrigin": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "countryOfManufacture": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "classificationCodes": { - "type": "object", - "description": "Classification codes of this product for export.", - "properties": { - "eccn": { - "type": "string", - "description": "Export Control Classification Number (ECCN).", - "minLength": 0, - "maxLength": 5 - }, - "scheduleBinfo": { - "type": "string", - "description": "Classification code for exporting goods out of the United States.", - "minLength": 0, - "maxLength": 15 - }, - "hsCode": { - "type": "string", - "description": "Harmonized Commodity Description and Coding System.", - "minLength": 2, - "maxLength": 10 - } - } - }, - "customAttributes": { - "default": [], - "type": "array", - "items": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "pattern": "^[a-zA-Z0-9_-]+$" - }, - "value": { - "type": [ - "number", - "integer", - "string", - "boolean" - ] - } - }, - "additionalProperties": false - } - } - } - } - } - } - } - }, - "StoredShipment": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "object", - "required": [ - "type", - "attributes", - "id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shipment" - ] - }, - "id": { - "description": "Id of the shipment.", - "type": "string" - }, - "attributes": { - "description": "The Shipment Creation Request Schema", - "type": "object", - "required": [ - "origin", - "destination", - "pickupAt", - "packages" - ], - "properties": { - "pickupAt": { - "type": "string", - "description": "The expected pickup time", - "format": "date-time" - }, - "expectedAt": { - "type": "string", - "description": "An expected delivery date-time", - "format": "date-time" - }, - "customerReference": { - "description": "A consistent identifier that represents a clients customer", - "type": "string" - }, - "origin": { - "type": "object", - "required": [ - "address" - ], - "additionalProperties": false, - "properties": { - "name": { - "description": "Merchant location name.", - "type": "string" - }, - "type": { - "description": "The type of location.", - "enum": [ - "Store", - "Warehouse", - "Drop Shipper", - "Collection Point", - "Click & Collect", - "Headquarters" - ] - }, - "address": { - "description": "This is the schema for representing an address", - "type": "object", - "required": [ - "countryCode", - "postalCode", - "locality", - "administrativeArea" - ], - "properties": { - "isOrganisation": { - "description": "Does this address belong to an organisation?", - "type": "boolean" - }, - "line": { - "description": "(required - fulfill) Lines of the address", - "type": "array", - "items": { - "type": "string" - } - }, - "countryCode": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "postalCode": { - "type": "string", - "description": "The post or zip code of this address." - }, - "locality": { - "type": "string", - "description": "The locality (i.e city, township) of this address. Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area." - }, - "dependentLocality": { - "type": "string", - "description": "The dependent locality (i.e neighbourhood) of this address. When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality," - }, - "administrativeArea": { - "type": "string", - "description": "The administrative area of this address, ie. state." - }, - "longitude": { - "type": "number", - "description": "The longitude value of a geocoded address." - }, - "latitude": { - "type": "number", - "description": "The latitude value of a geocoded address." - } - } - }, - "contact": { - "description": "This is the schema for representing entity", - "type": "object", - "additionalProperties": false, - "properties": { - "organisationName": { - "type": "string", - "description": "Organisation name of this entity." - }, - "personFirstName": { - "type": "string", - "description": "First name of this entity." - }, - "personLastName": { - "type": "string", - "description": "Last name of this entity." - }, - "email": { - "type": "string", - "description": "Email of this entity.", - "format": "email" - }, - "phoneNumbers": { - "type": "array", - "description": "List of phone number(s) of this entity", - "items": { - "type": "string" - } - }, - "faxNumber": { - "type": "string" - }, - "nationalIdentificationNumber": { - "type": "string", - "description": "National identification number of this entity, ie. INSEE code (France)" - }, - "taxIdentificationNumber": { - "type": "string", - "description": "Tax identification number of this entity, ie. TFN (Australia), TIN (France)" - } - } - }, - "customAttributes": { - "default": [], - "type": "array", - "items": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "pattern": "^[a-zA-Z0-9_-]+$" - }, - "value": { - "type": [ - "number", - "integer", - "string", - "boolean" - ] - } - }, - "additionalProperties": false - } - } - } - }, - "destination": { - "type": "object", - "required": [ - "address" - ], - "additionalProperties": false, - "properties": { - "name": { - "description": "Merchant location name.", - "type": "string" - }, - "type": { - "description": "The type of location.", - "enum": [ - "Store", - "Warehouse", - "Drop Shipper", - "Collection Point", - "Click & Collect", - "Headquarters" - ] - }, - "address": { - "description": "This is the schema for representing an address", - "type": "object", - "required": [ - "countryCode", - "postalCode", - "locality", - "administrativeArea" - ], - "properties": { - "isOrganisation": { - "description": "Does this address belong to an organisation?", - "type": "boolean" - }, - "line": { - "description": "(required - fulfill) Lines of the address", - "type": "array", - "items": { - "type": "string" - } - }, - "countryCode": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "postalCode": { - "type": "string", - "description": "The post or zip code of this address." - }, - "locality": { - "type": "string", - "description": "The locality (i.e city, township) of this address. Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area." - }, - "dependentLocality": { - "type": "string", - "description": "The dependent locality (i.e neighbourhood) of this address. When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality," - }, - "administrativeArea": { - "type": "string", - "description": "The administrative area of this address, ie. state." - }, - "longitude": { - "type": "number", - "description": "The longitude value of a geocoded address." - }, - "latitude": { - "type": "number", - "description": "The latitude value of a geocoded address." - } - } - }, - "contact": { - "description": "This is the schema for representing entity", - "type": "object", - "additionalProperties": false, - "properties": { - "organisationName": { - "type": "string", - "description": "Organisation name of this entity." - }, - "personFirstName": { - "type": "string", - "description": "First name of this entity." - }, - "personLastName": { - "type": "string", - "description": "Last name of this entity." - }, - "email": { - "type": "string", - "description": "Email of this entity.", - "format": "email" - }, - "phoneNumbers": { - "type": "array", - "description": "List of phone number(s) of this entity", - "items": { - "type": "string" - } - }, - "faxNumber": { - "type": "string" - }, - "nationalIdentificationNumber": { - "type": "string", - "description": "National identification number of this entity, ie. INSEE code (France)" - }, - "taxIdentificationNumber": { - "type": "string", - "description": "Tax identification number of this entity, ie. TFN (Australia), TIN (France)" - } - } - }, - "customAttributes": { - "default": [], - "type": "array", - "items": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "pattern": "^[a-zA-Z0-9_-]+$" - }, - "value": { - "type": [ - "number", - "integer", - "string", - "boolean" - ] - } - }, - "additionalProperties": false - } - } - } - }, - "packages": { - "type": "array", - "items": { - "description": "This is the schema for representing packages", - "type": "object", - "required": [ - "id", - "grossWeight", - "dimensions" - ], - "properties": { - "id": { - "description": "id of the package.", - "type": "string" - }, - "grossWeight": { - "type": "object", - "required": [ - "value", - "unitOfMeasurement" - ], - "properties": { - "value": { - "description": "The value of the weight unit", - "type": "number" - }, - "unitOfMeasurement": { - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - } - }, - "dimensions": { - "description": "This is the schema for representing dimensions", - "type": "object", - "additionalProperties": false, - "required": [ - "length", - "width", - "height", - "unitOfMeasurement" - ], - "properties": { - "length": { - "type": "number" - }, - "width": { - "type": "number" - }, - "height": { - "type": "number" - }, - "unitOfMeasurement": { - "description": "The distance unit the dimension's properties are in", - "type": "string", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - } - }, - "packageType": { - "description": "Package type", - "type": "string" - }, - "items": { - "type": "array", - "description": "(required - international fulfill) list of items", - "items": { - "description": "This is the schema for representing item", - "type": "object", - "properties": { - "product": { - "description": "This is the schema for representing product's attributes.", - "type": "object", - "properties": { - "merchantProductId": { - "description": "The product unique identifier, provided by the merchant", - "type": "string", - "maxLength": 100 - }, - "name": { - "type": "string", - "maxLength": 100 - }, - "sku": { - "type": "string", - "description": "The sku of this product.", - "maxLength": 100 - }, - "description": { - "type": "string", - "description": "The description of this product.", - "maxLength": 500 - }, - "category": { - "type": "string", - "description": "The category of this product." - }, - "unitOfMeasure": { - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "type": "string", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - "dimensions": { - "description": "This is the schema for representing dimensions", - "type": "object", - "additionalProperties": false, - "required": [ - "length", - "width", - "height", - "unitOfMeasurement" - ], - "properties": { - "length": { - "type": "number" - }, - "width": { - "type": "number" - }, - "height": { - "type": "number" - }, - "unitOfMeasurement": { - "description": "The distance unit the dimension's properties are in", - "type": "string", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - } - }, - "weight": { - "type": "object", - "required": [ - "value", - "unitOfMeasurement" - ], - "properties": { - "value": { - "description": "The value of the weight unit", - "type": "number" - }, - "unitOfMeasurement": { - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - } - }, - "monetaryValue": { - "description": "This is the schema for an representing money", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "description": "The amount of the currency", - "type": "number" - }, - "currency": { - "description": "The currency the money amount is", - "type": "string", - "maxLength": 3, - "minLength": 3 - } - } - }, - "isFragile": { - "type": "boolean", - "default": false - }, - "isVirtual": { - "type": "boolean", - "default": false - }, - "isPrePackaged": { - "description": "Whether the product has its own package", - "type": "boolean", - "default": false - }, - "canRotateVertical": { - "description": "Whether the product can be rotated vertically", - "type": "boolean", - "default": true - }, - "countryOfOrigin": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "countryOfManufacture": { - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code.", - "type": "string", - "minLength": 2, - "maxLength": 2 - }, - "classificationCodes": { - "type": "object", - "description": "Classification codes of this product for export.", - "properties": { - "eccn": { - "type": "string", - "description": "Export Control Classification Number (ECCN).", - "minLength": 0, - "maxLength": 5 - }, - "scheduleBinfo": { - "type": "string", - "description": "Classification code for exporting goods out of the United States.", - "minLength": 0, - "maxLength": 15 - }, - "hsCode": { - "type": "string", - "description": "Harmonized Commodity Description and Coding System.", - "minLength": 2, - "maxLength": 10 - } - } - }, - "customAttributes": { - "default": [], - "type": "array", - "items": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "pattern": "^[a-zA-Z0-9_-]+$" - }, - "value": { - "type": [ - "number", - "integer", - "string", - "boolean" - ] - } - }, - "additionalProperties": false - } - } - } - }, - "quantity": { - "type": "number", - "minimum": 1, - "description": "Value of unit of quantity of this item" - } - } - } - }, - "documentation": { - "type": "array", - "items": { - "description": "A generic document response.", - "type": "object", - "required": [ - "encoding", - "mimeType", - "type" - ], - "properties": { - "description": { - "description": "Short description of the document.", - "type": "string" - }, - "mimeType": { - "description": "A standard mime-type representation of the file format.", - "type": "string", - "enum": [ - "application/epl", - "application/epl2", - "application/zpl", - "application/pdf", - "image/png", - "image/jpg", - "image/gif", - "image/bmp" - ] - }, - "encoding": { - "description": "The encoding of the data", - "type": "string", - "enum": [ - "base64", - "plainText" - ] - }, - "size": { - "description": "A standard ISO 216 paper size - https://en.wikipedia.org/wiki/ISO_216", - "type": "string", - "enum": [ - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "A8", - "A9", - "A10" - ] - }, - "type": { - "description": "The document type being generated", - "type": "string", - "enum": [ - "manifestSummary", - "customerInvoice", - "cn22", - "cn23", - "packagingList", - "packageLabels", - "certificateOfOrigin", - "NAFTA", - "commercialInvoice", - "CODTurnInPage", - "proofOfDelivery" - ] - }, - "url": { - "description": "The URL of a document stored on a remote HTTP server", - "type": "string", - "format": "uri" - } - } - } - } - } - } - }, - "requiredCapabilities": { - "description": "This is the schema for an representing capability", - "type": "object", - "properties": { - "authorityToLeave": { - "additionalProperties": false, - "type": "boolean" - }, - "signature": { - "type": "object", - "required": [ - "required" - ], - "additionalProperties": false, - "properties": { - "required": { - "type": "boolean" - }, - "onlyAdultCanSign": { - "type": "boolean" - }, - "onlyAddresseeCanSign": { - "type": "boolean" - } - } - }, - "cashOnDelivery": { - "type": "object", - "required": [ - "shippingInclusive" - ], - "properties": { - "charge": { - "description": "This is the schema for an representing money", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "description": "The amount of the currency", - "type": "number" - }, - "currency": { - "description": "The currency the money amount is", - "type": "string", - "maxLength": 3, - "minLength": 3 - } - } - }, - "shippingInclusive": { - "description": "Identifies if the cash on delivery includes the shipping cost", - "type": "boolean" - } - } - } - } - }, - "exportDeclaration": { - "description": "Type of fulfillment being chosen for a given shipment", - "type": "object", - "properties": { - "signatory": { - "description": "The signatory on a shipments' export declaration", - "type": "object", - "required": [ - "name", - "title" - ], - "properties": { - "name": { - "description": "Name of signatory", - "type": "string" - }, - "title": { - "description": "Title of signatory", - "type": "string" - } - } - }, - "exportReason": { - "description": "A human readable description of the reason for the exportation", - "type": "string" - }, - "exportCategory": { - "description": "A broad classification of the export reason", - "type": "string" - }, - "declaredValue": { - "description": "This is the schema for an representing money", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "description": "The amount of the currency", - "type": "number" - }, - "currency": { - "description": "The currency the money amount is", - "type": "string", - "maxLength": 3, - "minLength": 3 - } - } - }, - "incoterm": { - "description": "Incoterm 2010 rules, series of pre-defined commercial terms.", - "enum": [ - "EXW", - "FCA", - "FAS", - "FOB", - "CPT", - "CFR", - "CIF", - "CIP", - "DAT", - "DAP", - "DDP" - ] - }, - "customAttributes": { - "default": [], - "type": "array", - "items": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "pattern": "^[a-zA-Z0-9_-]+$" - }, - "value": { - "type": [ - "number", - "integer", - "string", - "boolean" - ] - } - }, - "additionalProperties": false - } - } - } - }, - "documentation": { - "type": "array", - "items": { - "description": "A generic document response.", - "type": "object", - "required": [ - "encoding", - "mimeType", - "type" - ], - "properties": { - "description": { - "description": "Short description of the document.", - "type": "string" - }, - "mimeType": { - "description": "A standard mime-type representation of the file format.", - "type": "string", - "enum": [ - "application/epl", - "application/epl2", - "application/zpl", - "application/pdf", - "image/png", - "image/jpg", - "image/gif", - "image/bmp" - ] - }, - "encoding": { - "description": "The encoding of the data", - "type": "string", - "enum": [ - "base64", - "plainText" - ] - }, - "size": { - "description": "A standard ISO 216 paper size - https://en.wikipedia.org/wiki/ISO_216", - "type": "string", - "enum": [ - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "A8", - "A9", - "A10" - ] - }, - "type": { - "description": "The document type being generated", - "type": "string", - "enum": [ - "manifestSummary", - "customerInvoice", - "cn22", - "cn23", - "packagingList", - "packageLabels", - "certificateOfOrigin", - "NAFTA", - "commercialInvoice", - "CODTurnInPage", - "proofOfDelivery" - ] - }, - "url": { - "description": "The URL of a document stored on a remote HTTP server", - "type": "string", - "format": "uri" - } - } - } - }, - "fulfill": { - "type": "object", - "properties": { - "carrierBooking": { - "description": "The carrier booking information object", - "type": "object", - "additionalProperties": false, - "required": [ - "integrationId", - "integrationServiceId", - "shippingTaxInclusiveCharge", - "carrierName", - "serviceName", - "bookingReference", - "trackingReference" - ], - "properties": { - "integrationId": { - "description": "The identifier of the integration to you want to communicate with", - "type": "string" - }, - "integrationServiceId": { - "description": "A consistent identifier that represents a unique carrier service", - "type": "string" - }, - "shippingTaxInclusiveCharge": { - "description": "This is the schema for an representing money", - "type": "object", - "additionalProperties": false, - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "description": "The amount of the currency", - "type": "number" - }, - "currency": { - "description": "The currency the money amount is", - "type": "string", - "maxLength": 3, - "minLength": 3 - } - } - }, - "carrierName": { - "description": "A human understandable reference that represents a carrier", - "type": "string" - }, - "serviceName": { - "description": "A human understandable reference that represents a carrier service", - "type": "string" - }, - "carrierSortCode": { - "description": "An identifier used by a carrier to determinine shipment sorting", - "type": "string" - }, - "bookingReference": { - "type": "string" - }, - "trackingReference": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "included": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type", - "id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "order" - ] - }, - "id": { - "description": "An Temando order identifier", - "type": "string" - } - } - } - } - } - }, - "Error": { - "type": "object", - "properties": { - "error": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": [ - "code", - "description" - ] - } - }, - "required": [ - "error" - ] - } - }, - "responses": {}, - "parameters": {}, - "examples": {}, - "requestBodies": {}, - "securitySchemes": {}, - "headers": {} - } -} diff --git a/test/parser/open-api/v3/data/outputs/accounts.json b/test/parser/open-api/v3/data/outputs/accounts.json index 37f93ef..a4c7234 100644 --- a/test/parser/open-api/v3/data/outputs/accounts.json +++ b/test/parser/open-api/v3/data/outputs/accounts.json @@ -33,7 +33,9 @@ "name": "id", "description": "Id of the account", "required": true, - "type": "string" + "type": [ + "string" + ] } ], "query": [ @@ -41,13 +43,17 @@ "name": "offset", "description": "Offset for the result set", "required": true, - "type": "string" + "type": [ + "string" + ] }, { "name": "limit", "description": "Limit for the result set", "required": true, - "type": "string" + "type": [ + "string" + ] } ] }, @@ -61,12 +67,16 @@ "schema": [ { "name": "data", - "type": "array", + "type": [ + "array" + ], "required": true, "properties": [ { "name": "type", - "type": "string", + "type": [ + "string" + ], "required": true, "enum": [ "user" @@ -74,30 +84,40 @@ }, { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "User id" }, { "name": "attributes", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "firstName", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "First name" }, { "name": "lastName", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "Last name" }, { "name": "email", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "Email of the user" } @@ -137,42 +157,58 @@ "schema": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "status", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "title", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "detail", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "meta", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "links", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "source", - "type": "object", + "type": [ + "object" + ], "required": false } ], @@ -194,42 +230,58 @@ "schema": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "status", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "title", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "detail", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "meta", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "links", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "source", - "type": "object", + "type": [ + "object" + ], "required": false } ], @@ -251,42 +303,58 @@ "schema": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "status", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "title", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "detail", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "meta", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "links", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "source", - "type": "object", + "type": [ + "object" + ], "required": false } ] @@ -304,7 +372,9 @@ "name": "id", "description": "Id of the account", "required": true, - "type": "string" + "type": [ + "string" + ] } ] }, @@ -313,49 +383,65 @@ "schema": [ { "name": "data", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "type", - "type": "string", + "type": [ + "string" + ], "required": true, "enum": [ - "user" - ] + "user" + ] }, { "name": "attributes", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "firstName", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "First name" }, { "name": "lastName", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "Last name" }, { "name": "password", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "Password" }, { "name": "email", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "Email of the user" }, { "name": "bearerToken", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "Bearer token of the account" } @@ -372,12 +458,16 @@ "schema": [ { "name": "data", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "type", - "type": "string", + "type": [ + "string" + ], "required": true, "enum": [ "user" @@ -385,13 +475,17 @@ }, { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": true, "description": "User id" }, { "name": "attributes", - "type": "object", + "type": [ + "object" + ], "required": true } ] @@ -413,42 +507,58 @@ "schema": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "status", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "title", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "detail", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "meta", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "links", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "source", - "type": "object", + "type": [ + "object" + ], "required": false } ], @@ -470,42 +580,58 @@ "schema": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "status", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "title", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "detail", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "meta", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "links", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "source", - "type": "object", + "type": [ + "object" + ], "required": false } ], @@ -527,42 +653,58 @@ "schema": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "status", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "title", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "detail", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "meta", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "links", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "source", - "type": "object", + "type": [ + "object" + ], "required": false } ], @@ -598,42 +740,58 @@ "schema": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "status", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "title", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "detail", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "meta", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": false }, { "name": "links", - "type": "object", + "type": [ + "object" + ], "required": false }, { "name": "source", - "type": "object", + "type": [ + "object" + ], "required": false } ] diff --git a/test/parser/open-api/v3/data/outputs/carrier.json b/test/parser/open-api/v3/data/outputs/carrier.json index c9a8674..6fc2282 100644 --- a/test/parser/open-api/v3/data/outputs/carrier.json +++ b/test/parser/open-api/v3/data/outputs/carrier.json @@ -32,17 +32,23 @@ "schema": [ { "name": "data", - "type": "array", + "type": [ + "array" + ], "required": true, "properties": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "type", - "type": "string", + "type": [ + "string" + ], "required": true, "enum": [ "carrier-integration" @@ -50,37 +56,51 @@ }, { "name": "attributes", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "name", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "description", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "logo", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "services", - "type": "array", + "type": [ + "array" + ], "required": true, "properties": [ { "name": "id", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "name", - "type": "string", + "type": [ + "string" + ], "required": true } ] @@ -97,17 +117,23 @@ "schema": [ { "name": "error", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "description", - "type": "string", + "type": [ + "string" + ], "required": true } ] @@ -120,17 +146,23 @@ "schema": [ { "name": "error", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "code", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "description", - "type": "string", + "type": [ + "string" + ], "required": true } ] @@ -143,54 +175,74 @@ "schema": [ { "name": "error", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "description", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "code", - "type": "integer", + "type": [ + "integer" + ], "required": true }, { "name": "details", - "type": "array", + "type": [ + "array" + ], "required": true, "properties": [ { "name": "keyword", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "dataPath", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "schemaPath", - "type": "string", + "type": [ + "string" + ], "required": true }, { "name": "params", - "type": "object", + "type": [ + "object" + ], "required": true, "properties": [ { "name": "format", - "type": "string", + "type": [ + "string" + ], "required": true } ] }, { "name": "message", - "type": "string", + "type": [ + "string" + ], "required": true } ] @@ -207,21 +259,27 @@ "name": "offset", "description": "Offset for the returned array of records", "required": false, - "type": "number", + "type": [ + "number" + ], "defaultValue": 0 }, { "name": "limit", "description": "Limit for the returned array of records.", "required": false, - "type": "number", + "type": [ + "number" + ], "defaultValue": 10 }, { "name": "filter[registered]", "description": "Filter by integrations already registered with.", "required": false, - "type": "boolean", + "type": [ + "boolean" + ], "defaultValue": false } ] diff --git a/test/parser/open-api/v3/data/outputs/shipping.json b/test/parser/open-api/v3/data/outputs/shipping.json deleted file mode 100644 index 416535f..0000000 --- a/test/parser/open-api/v3/data/outputs/shipping.json +++ /dev/null @@ -1,5892 +0,0 @@ -{ - "title": "Temando API", - "version": "1.0.0", - "description": "Providing consumers with more choice and lowering the cost of shipping.", - "navigation": [ - { - "title": "Product", - "methods": [ - { - "type": "get", - "title": "Get list of Products in the account document.", - "link": "/products/get" - }, - { - "type": "post", - "title": "Create a Product object in the account.", - "link": "/products/post" - }, - { - "type": "get", - "title": "Get Product from account document.", - "link": "/products/{id}/get" - }, - { - "type": "put", - "title": "Update Product.", - "link": "/products/{id}/put" - }, - { - "type": "delete", - "title": "Remove Products.", - "link": "/products/{id}/delete" - } - ] - }, - { - "title": "Shipment", - "methods": [ - { - "type": "get", - "title": "Get shipment from account document by id.", - "link": "/shipments/{id}/get" - }, - { - "type": "put", - "title": "Update Shipment.", - "link": "/shipments/{id}/put" - } - ] - } - ], - "services": [ - { - "title": "Product", - "methods": [ - { - "type": "get", - "link": "/products/get", - "summary": "Get list of Products in the account document.", - "request": { - "description": "Get list of Products in the account document." - }, - "responses": [ - { - "code": "200", - "description": "List of all of the Products defined.", - "schema": [ - { - "name": "data", - "type": "array", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "product" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "GUID of the object." - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": true, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": true - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - { - "code": "422", - "description": "The request schema did not meet the specification.", - "schema": [ - { - "name": "id", - "type": "string", - "required": false - }, - { - "name": "status", - "type": "string", - "required": false - }, - { - "name": "title", - "type": "string", - "required": false - }, - { - "name": "detail", - "type": "string", - "required": false - }, - { - "name": "meta", - "type": "object", - "required": false - }, - { - "name": "code", - "type": "string", - "required": false - }, - { - "name": "links", - "type": "object", - "required": false - }, - { - "name": "source", - "type": "object", - "required": false - } - ] - } - ], - "description": "Get list of Products in the account document.", - "parameters": { - "query": [ - { - "name": "offset", - "description": "Offset for the returned array of records", - "required": false, - "type": "number" - }, - { - "name": "limit", - "description": "Limit for the returned array of records.", - "required": false, - "type": "number" - } - ] - } - }, - { - "type": "post", - "link": "/products/post", - "summary": "Create a Product object in the account.", - "request": { - "description": "Create a Product object in the account.", - "schema": [ - { - "name": "data", - "type": "object", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "product" - ] - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": true, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": true - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - "responses": [ - { - "code": "201", - "description": "Newly created Product with unique ID.", - "schema": [ - { - "name": "data", - "type": "object", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "product" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "GUID of the object." - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": true, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": true - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - { - "code": "422", - "description": "The request schema did not meet the specification.", - "schema": [ - { - "name": "id", - "type": "string", - "required": false - }, - { - "name": "status", - "type": "string", - "required": false - }, - { - "name": "title", - "type": "string", - "required": false - }, - { - "name": "detail", - "type": "string", - "required": false - }, - { - "name": "meta", - "type": "object", - "required": false - }, - { - "name": "code", - "type": "string", - "required": false - }, - { - "name": "links", - "type": "object", - "required": false - }, - { - "name": "source", - "type": "object", - "required": false - } - ] - } - ], - "description": "Create a Product object in the account.", - "parameters": {} - }, - { - "type": "get", - "link": "/products/{id}/get", - "summary": "Get Product from account document.", - "request": { - "description": "Get Product from account document." - }, - "responses": [ - { - "code": "200", - "description": "Return the Product specified by ID parameter", - "schema": [ - { - "name": "data", - "type": "object", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "product" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "GUID of the object." - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": true, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": true - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - { - "code": "404", - "description": "The resource could not be found.", - "schema": [ - { - "name": "id", - "type": "string", - "required": false - }, - { - "name": "status", - "type": "string", - "required": false - }, - { - "name": "title", - "type": "string", - "required": false - }, - { - "name": "detail", - "type": "string", - "required": false - }, - { - "name": "meta", - "type": "object", - "required": false - }, - { - "name": "code", - "type": "string", - "required": false - }, - { - "name": "links", - "type": "object", - "required": false - }, - { - "name": "source", - "type": "object", - "required": false - } - ] - }, - { - "code": "422", - "description": "The request schema did not meet the specification.", - "schema": [ - { - "name": "id", - "type": "string", - "required": false - }, - { - "name": "status", - "type": "string", - "required": false - }, - { - "name": "title", - "type": "string", - "required": false - }, - { - "name": "detail", - "type": "string", - "required": false - }, - { - "name": "meta", - "type": "object", - "required": false - }, - { - "name": "code", - "type": "string", - "required": false - }, - { - "name": "links", - "type": "object", - "required": false - }, - { - "name": "source", - "type": "object", - "required": false - } - ] - } - ], - "description": "Get Product from account document.", - "parameters": { - "path": [ - { - "name": "id", - "description": "id of Product to fetch", - "required": true, - "type": "integer" - } - ] - } - }, - { - "type": "put", - "link": "/products/{id}/put", - "summary": "Update Product.", - "request": { - "description": "Update Product in account document.", - "schema": [ - { - "name": "data", - "type": "object", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "product" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "GUID of the object." - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": true, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": true - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - "responses": [ - { - "code": "200", - "description": "Successfully updated the Product.", - "schema": [ - { - "name": "data", - "type": "object", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "product" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "GUID of the object." - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": true, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": true - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - { - "code": "404", - "description": "The resource could not be found.", - "schema": [ - { - "name": "id", - "type": "string", - "required": false - }, - { - "name": "status", - "type": "string", - "required": false - }, - { - "name": "title", - "type": "string", - "required": false - }, - { - "name": "detail", - "type": "string", - "required": false - }, - { - "name": "meta", - "type": "object", - "required": false - }, - { - "name": "code", - "type": "string", - "required": false - }, - { - "name": "links", - "type": "object", - "required": false - }, - { - "name": "source", - "type": "object", - "required": false - } - ] - }, - { - "code": "422", - "description": "The request schema did not meet the specification.", - "schema": [ - { - "name": "id", - "type": "string", - "required": false - }, - { - "name": "status", - "type": "string", - "required": false - }, - { - "name": "title", - "type": "string", - "required": false - }, - { - "name": "detail", - "type": "string", - "required": false - }, - { - "name": "meta", - "type": "object", - "required": false - }, - { - "name": "code", - "type": "string", - "required": false - }, - { - "name": "links", - "type": "object", - "required": false - }, - { - "name": "source", - "type": "object", - "required": false - } - ] - } - ], - "description": "Update Product in account document.", - "parameters": { - "path": [ - { - "name": "id", - "description": "id of Product to update", - "required": true, - "type": "integer" - } - ] - } - }, - { - "type": "delete", - "link": "/products/{id}/delete", - "summary": "Remove Products.", - "request": { - "description": "Remove Product from account document." - }, - "responses": [ - { - "code": "204", - "description": "Successfully deleted the Product." - }, - { - "code": "404", - "description": "The resource could not be found.", - "schema": [ - { - "name": "id", - "type": "string", - "required": false - }, - { - "name": "status", - "type": "string", - "required": false - }, - { - "name": "title", - "type": "string", - "required": false - }, - { - "name": "detail", - "type": "string", - "required": false - }, - { - "name": "meta", - "type": "object", - "required": false - }, - { - "name": "code", - "type": "string", - "required": false - }, - { - "name": "links", - "type": "object", - "required": false - }, - { - "name": "source", - "type": "object", - "required": false - } - ] - }, - { - "code": "422", - "description": "The request schema did not meet the specification.", - "schema": [ - { - "name": "id", - "type": "string", - "required": false - }, - { - "name": "status", - "type": "string", - "required": false - }, - { - "name": "title", - "type": "string", - "required": false - }, - { - "name": "detail", - "type": "string", - "required": false - }, - { - "name": "meta", - "type": "object", - "required": false - }, - { - "name": "code", - "type": "string", - "required": false - }, - { - "name": "links", - "type": "object", - "required": false - }, - { - "name": "source", - "type": "object", - "required": false - } - ] - } - ], - "description": "Remove Product from account document.", - "parameters": { - "path": [ - { - "name": "id", - "description": "id of Product to remove", - "required": true, - "type": "integer" - } - ] - } - } - ] - }, - { - "title": "Shipment", - "methods": [ - { - "type": "get", - "link": "/shipments/{id}/get", - "summary": "Get shipment from account document by id.", - "request": {}, - "responses": [ - { - "code": "200", - "description": "Return the shipment specified by id parameter", - "schema": [ - { - "name": "data", - "type": "object", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "shipment" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "Id of the shipment." - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "The Shipment Creation Request Schema", - "properties": [ - { - "name": "pickupAt", - "type": "string", - "required": true, - "description": "The expected pickup time" - }, - { - "name": "expectedAt", - "type": "string", - "required": false, - "description": "An expected delivery date-time" - }, - { - "name": "customerReference", - "type": "string", - "required": false, - "description": "A consistent identifier that represents a clients customer" - }, - { - "name": "origin", - "type": "object", - "required": true, - "properties": [ - { - "name": "name", - "type": "string", - "required": false, - "description": "Merchant location name." - }, - { - "name": "type", - "type": "string", - "required": false, - "description": "The type of location.", - "enum": [ - "Store", - "Warehouse", - "Drop Shipper", - "Collection Point", - "Click & Collect", - "Headquarters" - ] - }, - { - "name": "address", - "type": "object", - "required": true, - "description": "This is the schema for representing an address", - "properties": [ - { - "name": "isOrganisation", - "type": "boolean", - "required": false, - "description": "Does this address belong to an organisation?" - }, - { - "name": "line", - "type": "array", - "required": false, - "description": "(required - fulfill) Lines of the address", - "subtype": "string" - }, - { - "name": "countryCode", - "type": "string", - "required": true, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "postalCode", - "type": "string", - "required": true, - "description": "The post or zip code of this address." - }, - { - "name": "locality", - "type": "string", - "required": true, - "description": "The locality (i.e city, township) of this address. Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area." - }, - { - "name": "dependentLocality", - "type": "string", - "required": false, - "description": "The dependent locality (i.e neighbourhood) of this address. When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality," - }, - { - "name": "administrativeArea", - "type": "string", - "required": true, - "description": "The administrative area of this address, ie. state." - }, - { - "name": "longitude", - "type": "number", - "required": false, - "description": "The longitude value of a geocoded address." - }, - { - "name": "latitude", - "type": "number", - "required": false, - "description": "The latitude value of a geocoded address." - } - ] - }, - { - "name": "contact", - "type": "object", - "required": false, - "description": "This is the schema for representing entity", - "properties": [ - { - "name": "organisationName", - "type": "string", - "required": false, - "description": "Organisation name of this entity." - }, - { - "name": "personFirstName", - "type": "string", - "required": false, - "description": "First name of this entity." - }, - { - "name": "personLastName", - "type": "string", - "required": false, - "description": "Last name of this entity." - }, - { - "name": "email", - "type": "string", - "required": false, - "description": "Email of this entity." - }, - { - "name": "phoneNumbers", - "type": "array", - "required": false, - "description": "List of phone number(s) of this entity", - "subtype": "string" - }, - { - "name": "faxNumber", - "type": "string", - "required": false - }, - { - "name": "nationalIdentificationNumber", - "type": "string", - "required": false, - "description": "National identification number of this entity, ie. INSEE code (France)" - }, - { - "name": "taxIdentificationNumber", - "type": "string", - "required": false, - "description": "Tax identification number of this entity, ie. TFN (Australia), TIN (France)" - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "destination", - "type": "object", - "required": true, - "properties": [ - { - "name": "name", - "type": "string", - "required": false, - "description": "Merchant location name." - }, - { - "name": "type", - "type": "string", - "required": false, - "description": "The type of location.", - "enum": [ - "Store", - "Warehouse", - "Drop Shipper", - "Collection Point", - "Click & Collect", - "Headquarters" - ] - }, - { - "name": "address", - "type": "object", - "required": true, - "description": "This is the schema for representing an address", - "properties": [ - { - "name": "isOrganisation", - "type": "boolean", - "required": false, - "description": "Does this address belong to an organisation?" - }, - { - "name": "line", - "type": "array", - "required": false, - "description": "(required - fulfill) Lines of the address", - "subtype": "string" - }, - { - "name": "countryCode", - "type": "string", - "required": true, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "postalCode", - "type": "string", - "required": true, - "description": "The post or zip code of this address." - }, - { - "name": "locality", - "type": "string", - "required": true, - "description": "The locality (i.e city, township) of this address. Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area." - }, - { - "name": "dependentLocality", - "type": "string", - "required": false, - "description": "The dependent locality (i.e neighbourhood) of this address. When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality," - }, - { - "name": "administrativeArea", - "type": "string", - "required": true, - "description": "The administrative area of this address, ie. state." - }, - { - "name": "longitude", - "type": "number", - "required": false, - "description": "The longitude value of a geocoded address." - }, - { - "name": "latitude", - "type": "number", - "required": false, - "description": "The latitude value of a geocoded address." - } - ] - }, - { - "name": "contact", - "type": "object", - "required": false, - "description": "This is the schema for representing entity", - "properties": [ - { - "name": "organisationName", - "type": "string", - "required": false, - "description": "Organisation name of this entity." - }, - { - "name": "personFirstName", - "type": "string", - "required": false, - "description": "First name of this entity." - }, - { - "name": "personLastName", - "type": "string", - "required": false, - "description": "Last name of this entity." - }, - { - "name": "email", - "type": "string", - "required": false, - "description": "Email of this entity." - }, - { - "name": "phoneNumbers", - "type": "array", - "required": false, - "description": "List of phone number(s) of this entity", - "subtype": "string" - }, - { - "name": "faxNumber", - "type": "string", - "required": false - }, - { - "name": "nationalIdentificationNumber", - "type": "string", - "required": false, - "description": "National identification number of this entity, ie. INSEE code (France)" - }, - { - "name": "taxIdentificationNumber", - "type": "string", - "required": false, - "description": "Tax identification number of this entity, ie. TFN (Australia), TIN (France)" - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "packages", - "type": "array", - "required": true, - "properties": [ - { - "name": "id", - "type": "string", - "required": true, - "description": "id of the package." - }, - { - "name": "grossWeight", - "type": "object", - "required": true, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "dimensions", - "type": "object", - "required": true, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "packageType", - "type": "string", - "required": false, - "description": "Package type" - }, - { - "name": "items", - "type": "array", - "required": false, - "description": "(required - international fulfill) list of items", - "properties": [ - { - "name": "product", - "type": "object", - "required": false, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": false, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": false - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "quantity", - "type": "number", - "required": false, - "description": "Value of unit of quantity of this item" - } - ] - }, - { - "name": "documentation", - "type": "array", - "required": false, - "properties": [ - { - "name": "description", - "type": "string", - "required": false, - "description": "Short description of the document." - }, - { - "name": "mimeType", - "type": "string", - "required": true, - "description": "A standard mime-type representation of the file format.", - "enum": [ - "application/epl", - "application/epl2", - "application/zpl", - "application/pdf", - "image/png", - "image/jpg", - "image/gif", - "image/bmp" - ] - }, - { - "name": "encoding", - "type": "string", - "required": true, - "description": "The encoding of the data", - "enum": [ - "base64", - "plainText" - ] - }, - { - "name": "size", - "type": "string", - "required": false, - "description": "A standard ISO 216 paper size - https://en.wikipedia.org/wiki/ISO_216", - "enum": [ - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "A8", - "A9", - "A10" - ] - }, - { - "name": "type", - "type": "string", - "required": true, - "description": "The document type being generated", - "enum": [ - "manifestSummary", - "customerInvoice", - "cn22", - "cn23", - "packagingList", - "packageLabels", - "certificateOfOrigin", - "NAFTA", - "commercialInvoice", - "CODTurnInPage", - "proofOfDelivery" - ] - }, - { - "name": "url", - "type": "string", - "required": false, - "description": "The URL of a document stored on a remote HTTP server" - } - ] - } - ] - }, - { - "name": "requiredCapabilities", - "type": "object", - "required": false, - "description": "This is the schema for an representing capability", - "properties": [ - { - "name": "authorityToLeave", - "type": "boolean", - "required": false - }, - { - "name": "signature", - "type": "object", - "required": false, - "properties": [ - { - "name": "required", - "type": "boolean", - "required": true - }, - { - "name": "onlyAdultCanSign", - "type": "boolean", - "required": false - }, - { - "name": "onlyAddresseeCanSign", - "type": "boolean", - "required": false - } - ] - }, - { - "name": "cashOnDelivery", - "type": "object", - "required": false, - "properties": [ - { - "name": "charge", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "shippingInclusive", - "type": "boolean", - "required": true, - "description": "Identifies if the cash on delivery includes the shipping cost" - } - ] - } - ] - }, - { - "name": "exportDeclaration", - "type": "object", - "required": false, - "description": "Type of fulfillment being chosen for a given shipment", - "properties": [ - { - "name": "signatory", - "type": "object", - "required": false, - "description": "The signatory on a shipments' export declaration", - "properties": [ - { - "name": "name", - "type": "string", - "required": true, - "description": "Name of signatory" - }, - { - "name": "title", - "type": "string", - "required": true, - "description": "Title of signatory" - } - ] - }, - { - "name": "exportReason", - "type": "string", - "required": false, - "description": "A human readable description of the reason for the exportation" - }, - { - "name": "exportCategory", - "type": "string", - "required": false, - "description": "A broad classification of the export reason" - }, - { - "name": "declaredValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "incoterm", - "type": "string", - "required": false, - "description": "Incoterm 2010 rules, series of pre-defined commercial terms.", - "enum": [ - "EXW", - "FCA", - "FAS", - "FOB", - "CPT", - "CFR", - "CIF", - "CIP", - "DAT", - "DAP", - "DDP" - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "documentation", - "type": "array", - "required": false, - "properties": [ - { - "name": "description", - "type": "string", - "required": false, - "description": "Short description of the document." - }, - { - "name": "mimeType", - "type": "string", - "required": true, - "description": "A standard mime-type representation of the file format.", - "enum": [ - "application/epl", - "application/epl2", - "application/zpl", - "application/pdf", - "image/png", - "image/jpg", - "image/gif", - "image/bmp" - ] - }, - { - "name": "encoding", - "type": "string", - "required": true, - "description": "The encoding of the data", - "enum": [ - "base64", - "plainText" - ] - }, - { - "name": "size", - "type": "string", - "required": false, - "description": "A standard ISO 216 paper size - https://en.wikipedia.org/wiki/ISO_216", - "enum": [ - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "A8", - "A9", - "A10" - ] - }, - { - "name": "type", - "type": "string", - "required": true, - "description": "The document type being generated", - "enum": [ - "manifestSummary", - "customerInvoice", - "cn22", - "cn23", - "packagingList", - "packageLabels", - "certificateOfOrigin", - "NAFTA", - "commercialInvoice", - "CODTurnInPage", - "proofOfDelivery" - ] - }, - { - "name": "url", - "type": "string", - "required": false, - "description": "The URL of a document stored on a remote HTTP server" - } - ] - }, - { - "name": "fulfill", - "type": "object", - "required": false, - "properties": [ - { - "name": "carrierBooking", - "type": "object", - "required": false, - "description": "The carrier booking information object", - "properties": [ - { - "name": "integrationId", - "type": "string", - "required": true, - "description": "The identifier of the integration to you want to communicate with" - }, - { - "name": "integrationServiceId", - "type": "string", - "required": true, - "description": "A consistent identifier that represents a unique carrier service" - }, - { - "name": "shippingTaxInclusiveCharge", - "type": "object", - "required": true, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "carrierName", - "type": "string", - "required": true, - "description": "A human understandable reference that represents a carrier" - }, - { - "name": "serviceName", - "type": "string", - "required": true, - "description": "A human understandable reference that represents a carrier service" - }, - { - "name": "carrierSortCode", - "type": "string", - "required": false, - "description": "An identifier used by a carrier to determinine shipment sorting" - }, - { - "name": "bookingReference", - "type": "string", - "required": true - }, - { - "name": "trackingReference", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "included", - "type": "array", - "required": false, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "order" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "An Temando order identifier" - } - ] - } - ] - }, - { - "code": "400", - "description": "Bad Request.", - "schema": [ - { - "name": "error", - "type": "object", - "required": true, - "properties": [ - { - "name": "code", - "type": "string", - "required": true - }, - { - "name": "description", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "code": "401", - "description": "Authentication failed.", - "schema": [ - { - "name": "error", - "type": "object", - "required": true, - "properties": [ - { - "name": "code", - "type": "string", - "required": true - }, - { - "name": "description", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "code": "404", - "description": "Not Found.", - "schema": [ - { - "name": "error", - "type": "object", - "required": true, - "properties": [ - { - "name": "code", - "type": "string", - "required": true - }, - { - "name": "description", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "code": "500", - "description": "Unexpected error.", - "schema": [ - { - "name": "error", - "type": "object", - "required": true, - "properties": [ - { - "name": "code", - "type": "string", - "required": true - }, - { - "name": "description", - "type": "string", - "required": true - } - ] - } - ] - } - ], - "parameters": { - "path": [ - { - "name": "id", - "description": "id of shipment to fetch", - "required": true, - "type": "string" - } - ] - } - }, - { - "type": "put", - "link": "/shipments/{id}/put", - "summary": "Update Shipment.", - "request": { - "description": "Update Shipment in account document.", - "schema": [ - { - "name": "data", - "type": "object", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "shipment" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "Id of the shipment." - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "The Shipment Creation Request Schema", - "properties": [ - { - "name": "pickupAt", - "type": "string", - "required": true, - "description": "The expected pickup time" - }, - { - "name": "expectedAt", - "type": "string", - "required": false, - "description": "An expected delivery date-time" - }, - { - "name": "customerReference", - "type": "string", - "required": false, - "description": "A consistent identifier that represents a clients customer" - }, - { - "name": "origin", - "type": "object", - "required": true, - "properties": [ - { - "name": "name", - "type": "string", - "required": false, - "description": "Merchant location name." - }, - { - "name": "type", - "type": "string", - "required": false, - "description": "The type of location.", - "enum": [ - "Store", - "Warehouse", - "Drop Shipper", - "Collection Point", - "Click & Collect", - "Headquarters" - ] - }, - { - "name": "address", - "type": "object", - "required": true, - "description": "This is the schema for representing an address", - "properties": [ - { - "name": "isOrganisation", - "type": "boolean", - "required": false, - "description": "Does this address belong to an organisation?" - }, - { - "name": "line", - "type": "array", - "required": false, - "description": "(required - fulfill) Lines of the address", - "subtype": "string" - }, - { - "name": "countryCode", - "type": "string", - "required": true, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "postalCode", - "type": "string", - "required": true, - "description": "The post or zip code of this address." - }, - { - "name": "locality", - "type": "string", - "required": true, - "description": "The locality (i.e city, township) of this address. Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area." - }, - { - "name": "dependentLocality", - "type": "string", - "required": false, - "description": "The dependent locality (i.e neighbourhood) of this address. When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality," - }, - { - "name": "administrativeArea", - "type": "string", - "required": true, - "description": "The administrative area of this address, ie. state." - }, - { - "name": "longitude", - "type": "number", - "required": false, - "description": "The longitude value of a geocoded address." - }, - { - "name": "latitude", - "type": "number", - "required": false, - "description": "The latitude value of a geocoded address." - } - ] - }, - { - "name": "contact", - "type": "object", - "required": false, - "description": "This is the schema for representing entity", - "properties": [ - { - "name": "organisationName", - "type": "string", - "required": false, - "description": "Organisation name of this entity." - }, - { - "name": "personFirstName", - "type": "string", - "required": false, - "description": "First name of this entity." - }, - { - "name": "personLastName", - "type": "string", - "required": false, - "description": "Last name of this entity." - }, - { - "name": "email", - "type": "string", - "required": false, - "description": "Email of this entity." - }, - { - "name": "phoneNumbers", - "type": "array", - "required": false, - "description": "List of phone number(s) of this entity", - "subtype": "string" - }, - { - "name": "faxNumber", - "type": "string", - "required": false - }, - { - "name": "nationalIdentificationNumber", - "type": "string", - "required": false, - "description": "National identification number of this entity, ie. INSEE code (France)" - }, - { - "name": "taxIdentificationNumber", - "type": "string", - "required": false, - "description": "Tax identification number of this entity, ie. TFN (Australia), TIN (France)" - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "destination", - "type": "object", - "required": true, - "properties": [ - { - "name": "name", - "type": "string", - "required": false, - "description": "Merchant location name." - }, - { - "name": "type", - "type": "string", - "required": false, - "description": "The type of location.", - "enum": [ - "Store", - "Warehouse", - "Drop Shipper", - "Collection Point", - "Click & Collect", - "Headquarters" - ] - }, - { - "name": "address", - "type": "object", - "required": true, - "description": "This is the schema for representing an address", - "properties": [ - { - "name": "isOrganisation", - "type": "boolean", - "required": false, - "description": "Does this address belong to an organisation?" - }, - { - "name": "line", - "type": "array", - "required": false, - "description": "(required - fulfill) Lines of the address", - "subtype": "string" - }, - { - "name": "countryCode", - "type": "string", - "required": true, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "postalCode", - "type": "string", - "required": true, - "description": "The post or zip code of this address." - }, - { - "name": "locality", - "type": "string", - "required": true, - "description": "The locality (i.e city, township) of this address. Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area." - }, - { - "name": "dependentLocality", - "type": "string", - "required": false, - "description": "The dependent locality (i.e neighbourhood) of this address. When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality," - }, - { - "name": "administrativeArea", - "type": "string", - "required": true, - "description": "The administrative area of this address, ie. state." - }, - { - "name": "longitude", - "type": "number", - "required": false, - "description": "The longitude value of a geocoded address." - }, - { - "name": "latitude", - "type": "number", - "required": false, - "description": "The latitude value of a geocoded address." - } - ] - }, - { - "name": "contact", - "type": "object", - "required": false, - "description": "This is the schema for representing entity", - "properties": [ - { - "name": "organisationName", - "type": "string", - "required": false, - "description": "Organisation name of this entity." - }, - { - "name": "personFirstName", - "type": "string", - "required": false, - "description": "First name of this entity." - }, - { - "name": "personLastName", - "type": "string", - "required": false, - "description": "Last name of this entity." - }, - { - "name": "email", - "type": "string", - "required": false, - "description": "Email of this entity." - }, - { - "name": "phoneNumbers", - "type": "array", - "required": false, - "description": "List of phone number(s) of this entity", - "subtype": "string" - }, - { - "name": "faxNumber", - "type": "string", - "required": false - }, - { - "name": "nationalIdentificationNumber", - "type": "string", - "required": false, - "description": "National identification number of this entity, ie. INSEE code (France)" - }, - { - "name": "taxIdentificationNumber", - "type": "string", - "required": false, - "description": "Tax identification number of this entity, ie. TFN (Australia), TIN (France)" - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "packages", - "type": "array", - "required": true, - "properties": [ - { - "name": "id", - "type": "string", - "required": true, - "description": "id of the package." - }, - { - "name": "grossWeight", - "type": "object", - "required": true, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "dimensions", - "type": "object", - "required": true, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "packageType", - "type": "string", - "required": false, - "description": "Package type" - }, - { - "name": "items", - "type": "array", - "required": false, - "description": "(required - international fulfill) list of items", - "properties": [ - { - "name": "product", - "type": "object", - "required": false, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": false, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": false - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "quantity", - "type": "number", - "required": false, - "description": "Value of unit of quantity of this item" - } - ] - }, - { - "name": "documentation", - "type": "array", - "required": false, - "properties": [ - { - "name": "description", - "type": "string", - "required": false, - "description": "Short description of the document." - }, - { - "name": "mimeType", - "type": "string", - "required": true, - "description": "A standard mime-type representation of the file format.", - "enum": [ - "application/epl", - "application/epl2", - "application/zpl", - "application/pdf", - "image/png", - "image/jpg", - "image/gif", - "image/bmp" - ] - }, - { - "name": "encoding", - "type": "string", - "required": true, - "description": "The encoding of the data", - "enum": [ - "base64", - "plainText" - ] - }, - { - "name": "size", - "type": "string", - "required": false, - "description": "A standard ISO 216 paper size - https://en.wikipedia.org/wiki/ISO_216", - "enum": [ - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "A8", - "A9", - "A10" - ] - }, - { - "name": "type", - "type": "string", - "required": true, - "description": "The document type being generated", - "enum": [ - "manifestSummary", - "customerInvoice", - "cn22", - "cn23", - "packagingList", - "packageLabels", - "certificateOfOrigin", - "NAFTA", - "commercialInvoice", - "CODTurnInPage", - "proofOfDelivery" - ] - }, - { - "name": "url", - "type": "string", - "required": false, - "description": "The URL of a document stored on a remote HTTP server" - } - ] - } - ] - }, - { - "name": "requiredCapabilities", - "type": "object", - "required": false, - "description": "This is the schema for an representing capability", - "properties": [ - { - "name": "authorityToLeave", - "type": "boolean", - "required": false - }, - { - "name": "signature", - "type": "object", - "required": false, - "properties": [ - { - "name": "required", - "type": "boolean", - "required": true - }, - { - "name": "onlyAdultCanSign", - "type": "boolean", - "required": false - }, - { - "name": "onlyAddresseeCanSign", - "type": "boolean", - "required": false - } - ] - }, - { - "name": "cashOnDelivery", - "type": "object", - "required": false, - "properties": [ - { - "name": "charge", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "shippingInclusive", - "type": "boolean", - "required": true, - "description": "Identifies if the cash on delivery includes the shipping cost" - } - ] - } - ] - }, - { - "name": "exportDeclaration", - "type": "object", - "required": false, - "description": "Type of fulfillment being chosen for a given shipment", - "properties": [ - { - "name": "signatory", - "type": "object", - "required": false, - "description": "The signatory on a shipments' export declaration", - "properties": [ - { - "name": "name", - "type": "string", - "required": true, - "description": "Name of signatory" - }, - { - "name": "title", - "type": "string", - "required": true, - "description": "Title of signatory" - } - ] - }, - { - "name": "exportReason", - "type": "string", - "required": false, - "description": "A human readable description of the reason for the exportation" - }, - { - "name": "exportCategory", - "type": "string", - "required": false, - "description": "A broad classification of the export reason" - }, - { - "name": "declaredValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "incoterm", - "type": "string", - "required": false, - "description": "Incoterm 2010 rules, series of pre-defined commercial terms.", - "enum": [ - "EXW", - "FCA", - "FAS", - "FOB", - "CPT", - "CFR", - "CIF", - "CIP", - "DAT", - "DAP", - "DDP" - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "documentation", - "type": "array", - "required": false, - "properties": [ - { - "name": "description", - "type": "string", - "required": false, - "description": "Short description of the document." - }, - { - "name": "mimeType", - "type": "string", - "required": true, - "description": "A standard mime-type representation of the file format.", - "enum": [ - "application/epl", - "application/epl2", - "application/zpl", - "application/pdf", - "image/png", - "image/jpg", - "image/gif", - "image/bmp" - ] - }, - { - "name": "encoding", - "type": "string", - "required": true, - "description": "The encoding of the data", - "enum": [ - "base64", - "plainText" - ] - }, - { - "name": "size", - "type": "string", - "required": false, - "description": "A standard ISO 216 paper size - https://en.wikipedia.org/wiki/ISO_216", - "enum": [ - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "A8", - "A9", - "A10" - ] - }, - { - "name": "type", - "type": "string", - "required": true, - "description": "The document type being generated", - "enum": [ - "manifestSummary", - "customerInvoice", - "cn22", - "cn23", - "packagingList", - "packageLabels", - "certificateOfOrigin", - "NAFTA", - "commercialInvoice", - "CODTurnInPage", - "proofOfDelivery" - ] - }, - { - "name": "url", - "type": "string", - "required": false, - "description": "The URL of a document stored on a remote HTTP server" - } - ] - }, - { - "name": "fulfill", - "type": "object", - "required": false, - "properties": [ - { - "name": "carrierBooking", - "type": "object", - "required": false, - "description": "The carrier booking information object", - "properties": [ - { - "name": "integrationId", - "type": "string", - "required": true, - "description": "The identifier of the integration to you want to communicate with" - }, - { - "name": "integrationServiceId", - "type": "string", - "required": true, - "description": "A consistent identifier that represents a unique carrier service" - }, - { - "name": "shippingTaxInclusiveCharge", - "type": "object", - "required": true, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "carrierName", - "type": "string", - "required": true, - "description": "A human understandable reference that represents a carrier" - }, - { - "name": "serviceName", - "type": "string", - "required": true, - "description": "A human understandable reference that represents a carrier service" - }, - { - "name": "carrierSortCode", - "type": "string", - "required": false, - "description": "An identifier used by a carrier to determinine shipment sorting" - }, - { - "name": "bookingReference", - "type": "string", - "required": true - }, - { - "name": "trackingReference", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "included", - "type": "array", - "required": false, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "order" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "An Temando order identifier" - } - ] - } - ] - }, - "responses": [ - { - "code": "200", - "description": "Successfully updated the Shipment.", - "schema": [ - { - "name": "data", - "type": "object", - "required": true, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "shipment" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "Id of the shipment." - }, - { - "name": "attributes", - "type": "object", - "required": true, - "description": "The Shipment Creation Request Schema", - "properties": [ - { - "name": "pickupAt", - "type": "string", - "required": true, - "description": "The expected pickup time" - }, - { - "name": "expectedAt", - "type": "string", - "required": false, - "description": "An expected delivery date-time" - }, - { - "name": "customerReference", - "type": "string", - "required": false, - "description": "A consistent identifier that represents a clients customer" - }, - { - "name": "origin", - "type": "object", - "required": true, - "properties": [ - { - "name": "name", - "type": "string", - "required": false, - "description": "Merchant location name." - }, - { - "name": "type", - "type": "string", - "required": false, - "description": "The type of location.", - "enum": [ - "Store", - "Warehouse", - "Drop Shipper", - "Collection Point", - "Click & Collect", - "Headquarters" - ] - }, - { - "name": "address", - "type": "object", - "required": true, - "description": "This is the schema for representing an address", - "properties": [ - { - "name": "isOrganisation", - "type": "boolean", - "required": false, - "description": "Does this address belong to an organisation?" - }, - { - "name": "line", - "type": "array", - "required": false, - "description": "(required - fulfill) Lines of the address", - "subtype": "string" - }, - { - "name": "countryCode", - "type": "string", - "required": true, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "postalCode", - "type": "string", - "required": true, - "description": "The post or zip code of this address." - }, - { - "name": "locality", - "type": "string", - "required": true, - "description": "The locality (i.e city, township) of this address. Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area." - }, - { - "name": "dependentLocality", - "type": "string", - "required": false, - "description": "The dependent locality (i.e neighbourhood) of this address. When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality," - }, - { - "name": "administrativeArea", - "type": "string", - "required": true, - "description": "The administrative area of this address, ie. state." - }, - { - "name": "longitude", - "type": "number", - "required": false, - "description": "The longitude value of a geocoded address." - }, - { - "name": "latitude", - "type": "number", - "required": false, - "description": "The latitude value of a geocoded address." - } - ] - }, - { - "name": "contact", - "type": "object", - "required": false, - "description": "This is the schema for representing entity", - "properties": [ - { - "name": "organisationName", - "type": "string", - "required": false, - "description": "Organisation name of this entity." - }, - { - "name": "personFirstName", - "type": "string", - "required": false, - "description": "First name of this entity." - }, - { - "name": "personLastName", - "type": "string", - "required": false, - "description": "Last name of this entity." - }, - { - "name": "email", - "type": "string", - "required": false, - "description": "Email of this entity." - }, - { - "name": "phoneNumbers", - "type": "array", - "required": false, - "description": "List of phone number(s) of this entity", - "subtype": "string" - }, - { - "name": "faxNumber", - "type": "string", - "required": false - }, - { - "name": "nationalIdentificationNumber", - "type": "string", - "required": false, - "description": "National identification number of this entity, ie. INSEE code (France)" - }, - { - "name": "taxIdentificationNumber", - "type": "string", - "required": false, - "description": "Tax identification number of this entity, ie. TFN (Australia), TIN (France)" - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "destination", - "type": "object", - "required": true, - "properties": [ - { - "name": "name", - "type": "string", - "required": false, - "description": "Merchant location name." - }, - { - "name": "type", - "type": "string", - "required": false, - "description": "The type of location.", - "enum": [ - "Store", - "Warehouse", - "Drop Shipper", - "Collection Point", - "Click & Collect", - "Headquarters" - ] - }, - { - "name": "address", - "type": "object", - "required": true, - "description": "This is the schema for representing an address", - "properties": [ - { - "name": "isOrganisation", - "type": "boolean", - "required": false, - "description": "Does this address belong to an organisation?" - }, - { - "name": "line", - "type": "array", - "required": false, - "description": "(required - fulfill) Lines of the address", - "subtype": "string" - }, - { - "name": "countryCode", - "type": "string", - "required": true, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "postalCode", - "type": "string", - "required": true, - "description": "The post or zip code of this address." - }, - { - "name": "locality", - "type": "string", - "required": true, - "description": "The locality (i.e city, township) of this address. Some countries do not use this field; their address lines are sufficient to locate an address within a sub-administrative area." - }, - { - "name": "dependentLocality", - "type": "string", - "required": false, - "description": "The dependent locality (i.e neighbourhood) of this address. When representing a double-dependent locality in Great Britain, includes both the double-dependent locality and the dependent locality," - }, - { - "name": "administrativeArea", - "type": "string", - "required": true, - "description": "The administrative area of this address, ie. state." - }, - { - "name": "longitude", - "type": "number", - "required": false, - "description": "The longitude value of a geocoded address." - }, - { - "name": "latitude", - "type": "number", - "required": false, - "description": "The latitude value of a geocoded address." - } - ] - }, - { - "name": "contact", - "type": "object", - "required": false, - "description": "This is the schema for representing entity", - "properties": [ - { - "name": "organisationName", - "type": "string", - "required": false, - "description": "Organisation name of this entity." - }, - { - "name": "personFirstName", - "type": "string", - "required": false, - "description": "First name of this entity." - }, - { - "name": "personLastName", - "type": "string", - "required": false, - "description": "Last name of this entity." - }, - { - "name": "email", - "type": "string", - "required": false, - "description": "Email of this entity." - }, - { - "name": "phoneNumbers", - "type": "array", - "required": false, - "description": "List of phone number(s) of this entity", - "subtype": "string" - }, - { - "name": "faxNumber", - "type": "string", - "required": false - }, - { - "name": "nationalIdentificationNumber", - "type": "string", - "required": false, - "description": "National identification number of this entity, ie. INSEE code (France)" - }, - { - "name": "taxIdentificationNumber", - "type": "string", - "required": false, - "description": "Tax identification number of this entity, ie. TFN (Australia), TIN (France)" - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "packages", - "type": "array", - "required": true, - "properties": [ - { - "name": "id", - "type": "string", - "required": true, - "description": "id of the package." - }, - { - "name": "grossWeight", - "type": "object", - "required": true, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "dimensions", - "type": "object", - "required": true, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "packageType", - "type": "string", - "required": false, - "description": "Package type" - }, - { - "name": "items", - "type": "array", - "required": false, - "description": "(required - international fulfill) list of items", - "properties": [ - { - "name": "product", - "type": "object", - "required": false, - "description": "This is the schema for representing product's attributes.", - "properties": [ - { - "name": "merchantProductId", - "type": "string", - "required": false, - "description": "The product unique identifier, provided by the merchant" - }, - { - "name": "name", - "type": "string", - "required": false - }, - { - "name": "sku", - "type": "string", - "required": false, - "description": "The sku of this product." - }, - { - "name": "description", - "type": "string", - "required": false, - "description": "The description of this product." - }, - { - "name": "category", - "type": "string", - "required": false, - "description": "The category of this product." - }, - { - "name": "unitOfMeasure", - "type": "string", - "required": false, - "description": "The unit of measure that describes the product. Should be a value from Measures column at https://www.ups.com/worldshiphelp/WS12/ENU/AppHelp/Codes/Unit_of_Measure_Codes_for_Invoices.htm", - "enum": [ - "Bag", - "Barrel", - "Bolt", - "Box", - "Bunch", - "Bundle", - "Butt", - "Canister", - "Carton", - "Case", - "Centimeter", - "Container", - "Crate", - "Cylinder", - "Dozen", - "Each", - "Envelope", - "Foot", - "Kilogram", - "Kilograms", - "Liter", - "Meter", - "Number", - "Package", - "Packet", - "Pair", - "Pairs", - "Pallet", - "Piece", - "Pieces", - "Pound", - "Proof Liter", - "Roll", - "Set", - "Square Meter", - "Square Yard", - "Tube", - "Yard" - ] - }, - { - "name": "dimensions", - "type": "object", - "required": false, - "description": "This is the schema for representing dimensions", - "properties": [ - { - "name": "length", - "type": "number", - "required": true - }, - { - "name": "width", - "type": "number", - "required": true - }, - { - "name": "height", - "type": "number", - "required": true - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The distance unit the dimension's properties are in", - "enum": [ - "mm", - "millimeter", - "millimetre", - "cm", - "centimeter", - "centimetre", - "m", - "meter", - "metre", - "ft", - "foot", - "feet", - "in", - "inch", - "yd", - "yard" - ] - } - ] - }, - { - "name": "weight", - "type": "object", - "required": false, - "properties": [ - { - "name": "value", - "type": "number", - "required": true, - "description": "The value of the weight unit" - }, - { - "name": "unitOfMeasurement", - "type": "string", - "required": true, - "description": "The weight unit the value is", - "enum": [ - "g", - "gram", - "oz", - "ounce", - "kg", - "kilogram", - "lb", - "pound" - ] - } - ] - }, - { - "name": "monetaryValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "isFragile", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isVirtual", - "type": "boolean", - "required": false, - "defaultValue": false - }, - { - "name": "isPrePackaged", - "type": "boolean", - "required": false, - "description": "Whether the product has its own package", - "defaultValue": false - }, - { - "name": "canRotateVertical", - "type": "boolean", - "required": false, - "description": "Whether the product can be rotated vertically", - "defaultValue": true - }, - { - "name": "countryOfOrigin", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "countryOfManufacture", - "type": "string", - "required": false, - "description": "An ISO 3166-1 alpha-2 compliant two-letter country code." - }, - { - "name": "classificationCodes", - "type": "object", - "required": false, - "description": "Classification codes of this product for export.", - "properties": [ - { - "name": "eccn", - "type": "string", - "required": false, - "description": "Export Control Classification Number (ECCN)." - }, - { - "name": "scheduleBinfo", - "type": "string", - "required": false, - "description": "Classification code for exporting goods out of the United States." - }, - { - "name": "hsCode", - "type": "string", - "required": false, - "description": "Harmonized Commodity Description and Coding System." - } - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "quantity", - "type": "number", - "required": false, - "description": "Value of unit of quantity of this item" - } - ] - }, - { - "name": "documentation", - "type": "array", - "required": false, - "properties": [ - { - "name": "description", - "type": "string", - "required": false, - "description": "Short description of the document." - }, - { - "name": "mimeType", - "type": "string", - "required": true, - "description": "A standard mime-type representation of the file format.", - "enum": [ - "application/epl", - "application/epl2", - "application/zpl", - "application/pdf", - "image/png", - "image/jpg", - "image/gif", - "image/bmp" - ] - }, - { - "name": "encoding", - "type": "string", - "required": true, - "description": "The encoding of the data", - "enum": [ - "base64", - "plainText" - ] - }, - { - "name": "size", - "type": "string", - "required": false, - "description": "A standard ISO 216 paper size - https://en.wikipedia.org/wiki/ISO_216", - "enum": [ - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "A8", - "A9", - "A10" - ] - }, - { - "name": "type", - "type": "string", - "required": true, - "description": "The document type being generated", - "enum": [ - "manifestSummary", - "customerInvoice", - "cn22", - "cn23", - "packagingList", - "packageLabels", - "certificateOfOrigin", - "NAFTA", - "commercialInvoice", - "CODTurnInPage", - "proofOfDelivery" - ] - }, - { - "name": "url", - "type": "string", - "required": false, - "description": "The URL of a document stored on a remote HTTP server" - } - ] - } - ] - }, - { - "name": "requiredCapabilities", - "type": "object", - "required": false, - "description": "This is the schema for an representing capability", - "properties": [ - { - "name": "authorityToLeave", - "type": "boolean", - "required": false - }, - { - "name": "signature", - "type": "object", - "required": false, - "properties": [ - { - "name": "required", - "type": "boolean", - "required": true - }, - { - "name": "onlyAdultCanSign", - "type": "boolean", - "required": false - }, - { - "name": "onlyAddresseeCanSign", - "type": "boolean", - "required": false - } - ] - }, - { - "name": "cashOnDelivery", - "type": "object", - "required": false, - "properties": [ - { - "name": "charge", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "shippingInclusive", - "type": "boolean", - "required": true, - "description": "Identifies if the cash on delivery includes the shipping cost" - } - ] - } - ] - }, - { - "name": "exportDeclaration", - "type": "object", - "required": false, - "description": "Type of fulfillment being chosen for a given shipment", - "properties": [ - { - "name": "signatory", - "type": "object", - "required": false, - "description": "The signatory on a shipments' export declaration", - "properties": [ - { - "name": "name", - "type": "string", - "required": true, - "description": "Name of signatory" - }, - { - "name": "title", - "type": "string", - "required": true, - "description": "Title of signatory" - } - ] - }, - { - "name": "exportReason", - "type": "string", - "required": false, - "description": "A human readable description of the reason for the exportation" - }, - { - "name": "exportCategory", - "type": "string", - "required": false, - "description": "A broad classification of the export reason" - }, - { - "name": "declaredValue", - "type": "object", - "required": false, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "incoterm", - "type": "string", - "required": false, - "description": "Incoterm 2010 rules, series of pre-defined commercial terms.", - "enum": [ - "EXW", - "FCA", - "FAS", - "FOB", - "CPT", - "CFR", - "CIF", - "CIP", - "DAT", - "DAP", - "DDP" - ] - }, - { - "name": "customAttributes", - "type": "array", - "required": false, - "defaultValue": [], - "properties": [ - { - "name": "key", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "name": "documentation", - "type": "array", - "required": false, - "properties": [ - { - "name": "description", - "type": "string", - "required": false, - "description": "Short description of the document." - }, - { - "name": "mimeType", - "type": "string", - "required": true, - "description": "A standard mime-type representation of the file format.", - "enum": [ - "application/epl", - "application/epl2", - "application/zpl", - "application/pdf", - "image/png", - "image/jpg", - "image/gif", - "image/bmp" - ] - }, - { - "name": "encoding", - "type": "string", - "required": true, - "description": "The encoding of the data", - "enum": [ - "base64", - "plainText" - ] - }, - { - "name": "size", - "type": "string", - "required": false, - "description": "A standard ISO 216 paper size - https://en.wikipedia.org/wiki/ISO_216", - "enum": [ - "A0", - "A1", - "A2", - "A3", - "A4", - "A5", - "A6", - "A7", - "A8", - "A9", - "A10" - ] - }, - { - "name": "type", - "type": "string", - "required": true, - "description": "The document type being generated", - "enum": [ - "manifestSummary", - "customerInvoice", - "cn22", - "cn23", - "packagingList", - "packageLabels", - "certificateOfOrigin", - "NAFTA", - "commercialInvoice", - "CODTurnInPage", - "proofOfDelivery" - ] - }, - { - "name": "url", - "type": "string", - "required": false, - "description": "The URL of a document stored on a remote HTTP server" - } - ] - }, - { - "name": "fulfill", - "type": "object", - "required": false, - "properties": [ - { - "name": "carrierBooking", - "type": "object", - "required": false, - "description": "The carrier booking information object", - "properties": [ - { - "name": "integrationId", - "type": "string", - "required": true, - "description": "The identifier of the integration to you want to communicate with" - }, - { - "name": "integrationServiceId", - "type": "string", - "required": true, - "description": "A consistent identifier that represents a unique carrier service" - }, - { - "name": "shippingTaxInclusiveCharge", - "type": "object", - "required": true, - "description": "This is the schema for an representing money", - "properties": [ - { - "name": "amount", - "type": "number", - "required": true, - "description": "The amount of the currency" - }, - { - "name": "currency", - "type": "string", - "required": true, - "description": "The currency the money amount is" - } - ] - }, - { - "name": "carrierName", - "type": "string", - "required": true, - "description": "A human understandable reference that represents a carrier" - }, - { - "name": "serviceName", - "type": "string", - "required": true, - "description": "A human understandable reference that represents a carrier service" - }, - { - "name": "carrierSortCode", - "type": "string", - "required": false, - "description": "An identifier used by a carrier to determinine shipment sorting" - }, - { - "name": "bookingReference", - "type": "string", - "required": true - }, - { - "name": "trackingReference", - "type": "string", - "required": true - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "included", - "type": "array", - "required": false, - "properties": [ - { - "name": "type", - "type": "string", - "required": true, - "enum": [ - "order" - ] - }, - { - "name": "id", - "type": "string", - "required": true, - "description": "An Temando order identifier" - } - ] - } - ] - }, - { - "code": "401", - "description": "Authentication failed.", - "schema": [ - { - "name": "error", - "type": "object", - "required": true, - "properties": [ - { - "name": "code", - "type": "string", - "required": true - }, - { - "name": "description", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "code": "403", - "description": "Expired credentials.", - "schema": [ - { - "name": "error", - "type": "object", - "required": true, - "properties": [ - { - "name": "code", - "type": "string", - "required": true - }, - { - "name": "description", - "type": "string", - "required": true - } - ] - } - ] - }, - { - "code": "422", - "description": "The request schema did not meet the specification.", - "schema": [ - { - "name": "error", - "type": "object", - "required": true, - "properties": [ - { - "name": "code", - "type": "string", - "required": true - }, - { - "name": "description", - "type": "string", - "required": true - } - ] - } - ] - } - ], - "description": "Update Shipment in account document.", - "parameters": { - "path": [ - { - "name": "id", - "description": "id of Shipment to update", - "required": true, - "type": "integer" - } - ] - } - } - ] - } - ] -}