Skip to content

Instantly share code, notes, and snippets.

@devwuxus
Last active April 18, 2018 08:10
Show Gist options
  • Save devwuxus/cf48a8a38ab1ef8f10d624c66473ed90 to your computer and use it in GitHub Desktop.
Save devwuxus/cf48a8a38ab1ef8f10d624c66473ed90 to your computer and use it in GitHub Desktop.
{
"type": "object",
"properties": {
"version": {
"type": [
"string"
]
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"contractKey": {
"title": "Contract key",
"description": "A unique key signifying a specific contract between 2 companies - fx between you and your hauler.",
"type": [
"string"
]
},
"order": {
"title": "Order object",
"description": "The entire order object.",
"type": "object",
"required": [
"origin",
"destination"
],
"orderNumber": {
"title": "Order number",
"description": "Your own ordernumber - if any.",
"type": [
"string"
]
},
"requisition": {
"title": "Requisition number",
"description": "Any relevant requisition number, fx your customers own ordernumber",
"type": [
"string"
]
},
"orderType": {
"title": "Order type",
"description": "Can either be 'adhoc' which are A-to-B orders creating both a pickup and a delivery task for the driver, or 'distribution' which is expected to go through a 'Hub' and only have 1 task for the driver (pickup if the 'pickuped' field is false or delivery if 'pickuped' is true). 'distribution' orders requires the vehicle having a starting location. ",
"type": [
"string"
],
"enum": [
"adhoc",
"distribution"
]
},
"pickuped": {
"title": "Picked up boolean",
"description": "This is used to determine whether the order has already been picked up and simply need to be delivered. Set to 'true' if the order is a delivery from hub and set 'orderType' as 'distribution'.",
"type": [
"boolean"
]
},
"price": {
"title": "Price",
"description": "Meta data about the orders price - if relevant. The price is the provided in the currency's smallest unit. Fx $100 USD should be the value of 10000 (10000 cents)",
"type": "object",
"properties": {
"amount": {
"type": [
"number"
]
},
"currency": {
"type": [
"string"
]
}
}
},
"paidBy": {
"title": "Paid by",
"description": "A metadata string to identify who is paying for this order - if relevant.",
"type": [
"string"
]
},
"outletName": {
"title": "Outlet name",
"description": "A metadata string to identify which outlet the order is coming from - if relevant.",
"type": [
"string"
]
},
"sender": {
"title": "Sender",
"description": "Sender is tied together with 'origin', where 'origin' is the pickup place, 'sender' is the sender of the goods recognizable to the receiver.",
"type": "object",
"properties": {
"companyName": {
"title": "Company name",
"description": "Name of the company sending the goods. - Can be used for the customers name in case of a B2C customer.",
"type": [
"string"
]
},
"attention": {
"title": "Attention",
"description": "Name of a contact or department etc.",
"type": [
"string"
]
},
"address": {
"title": "Address",
"description": "The address string with both street and housenumber. We recommend that all address strings are compatible with Google Places. Note that zip and city has been separated.",
"type": [
"string"
]
},
"extraInfo": {
"title": "Extra address info",
"description": "Any address information aside from street and housenumber should be sent in this field. Fx '1st floor right' or 'Gate 5'.",
"type": [
"string"
]
},
"zipCode": {
"title": "Zipcode",
"description": "The zipcode of the address.",
"type": [
"string"
]
},
"city": {
"title": "City",
"description": "The city of the address.",
"type": [
"string"
]
},
"countryCode": {
"title": "Country code",
"description": "ISO-3166-1 alpha-2 country code. Read more at: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2",
"type": [
"string"
]
},
"email": {
"title": "Email",
"description": "Relevant email for sender - often tied to 'attention'.",
"type": [
"string"
]
},
"phone": {
"title": "Phone",
"description": "Phonenumber consisting of a prefix and a phonenumber in separate fields. Often tied to 'attention'.",
"type": "object",
"properties": {
"prefix": {
"type": [
"number"
]
},
"number": {
"type": [
"number"
]
}
}
},
"comments": {
"title": "Comments",
"description": "Any comments related to the sender.",
"type": [
"string"
]
}
}
},
"receiver": {
"title": "Receiver",
"description": "Receiver is tied together with 'destination', where 'destination' is the delivery place, 'receiver' is the legal receiver of the goods.",
"type": "object",
"properties": {
"companyName": {
"title": "Company name",
"description": "Name of the company receiving the goods. - Can be used for the customers name in case of a B2C customer.",
"type": [
"string"
]
},
"attention": {
"title": "Attention",
"description": "Name of a contact or department etc.",
"type": [
"string"
]
},
"address": {
"title": "Address",
"description": "The address string with both street and housenumber. We recommend that all address strings are compatible with Google Places. Note that zip and city has been separated.",
"type": [
"string"
]
},
"extraInfo": {
"title": "Extra address info",
"description": "Any address information aside from street and housenumber should be sent in this field. Fx '1st floor right' or 'Gate 5'.",
"type": [
"string"
]
},
"zipCode": {
"title": "Zipcode",
"description": "The zipcode of the address.",
"type": [
"string"
]
},
"city": {
"title": "City",
"description": "The city of the address.",
"type": [
"string"
]
},
"countryCode": {
"title": "Country code",
"description": "ISO-3166-1 alpha-2 country code. Read more at: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2",
"type": [
"string"
]
},
"email": {
"title": "Email",
"description": "Relevant email for receiver - often tied to 'attention'.",
"type": [
"string"
]
},
"phone": {
"title": "Phone",
"description": "Phonenumber consisting of a prefix and a phonenumber in separate fields. Often tied to 'attention'.",
"type": "object",
"properties": {
"prefix": {
"type": [
"number"
]
},
"number": {
"type": [
"number"
]
}
}
},
"comments": {
"title": "Comments",
"description": "Any comments related to the receiver.",
"type": [
"string"
]
}
}
},
"origin": {
"type": "object",
"required": [
"address",
"zipCode",
"city"
],
"properties": {
"companyName": {
"title": "Company name",
"description": "Name of the company where the goods are to be picked up. - Can be used for the customers name in case of a B2C customer.",
"type": [
"string"
]
},
"attention": {
"title": "Attention",
"description": "Name of a contact or department etc.",
"type": [
"string"
]
},
"address": {
"title": "Address",
"description": "The address string with both street and housenumber. We recommend that all address strings are compatible with Google Places. Note that zip and city has been separated.",
"type": [
"string"
]
},
"extraInfo": {
"title": "Extra address info",
"description": "Any address information aside from street and housenumber should be sent in this field. Fx '1st floor right' or 'Gate 5'.",
"type": [
"string"
]
},
"zipCode": {
"title": "Zipcode",
"description": "The zipcode of the address.",
"type": [
"string"
]
},
"city": {
"title": "City",
"description": "The city of the address.",
"type": [
"string"
]
},
"countryCode": {
"title": "Country code",
"description": "ISO-3166-1 alpha-2 country code. Read more at: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2",
"type": [
"string"
]
},
"email": {
"title": "Email",
"description": "Relevant email for the pickup location - often tied to 'attention'.",
"type": [
"string"
]
},
"phone": {
"title": "Phone",
"description": "Phonenumber consisting of a prefix and a phonenumber in separate fields. Often tied to 'attention'.",
"type": "object",
"properties": {
"prefix": {
"type": [
"number"
]
},
"number": {
"type": [
"number"
]
}
}
},
"timeWindow": {
"title": "Timewindow",
"description": "Times should ALWAYS be UTC. Here is defined a window for the pickup to occur. It consists of start time and an end time. If set, both dates MUST be the same date. Only the times can differ. A timewindow can be 'locked'. If there is no timewindow, set 'timeType' to be 'anytime'.",
"type": "object",
"properties": {
"start": {
"title": "Start of timewindow",
"description": "Must be in UTC. Should be the same date as 'end', and MUST be same or lower than 'end'. Use this if 'timeType' is either 'after' or 'between'.",
"type": [
"string"
],
"format": "date-time"
},
"end": {
"title": "End of timewindow",
"description": "Must be in UTC. Should be the same date as 'start', and MUST be same or higher than 'start'. Use this if 'timeType' is either 'before' or 'between'.",
"type": [
"string"
],
"format": "date-time"
},
"timeType": {
"title": "Timetype",
"description": "Used to define whether the given time is the following: 'between' indicates that the timewindow is between 'start' and 'end'. 'before' indicates that the timewindow is before 'end'. 'after' indicates that the timewindows is after 'start'. 'anytime' indicates there is no timewindow.",
"type": [
"string"
],
"enum": [
"between",
"before",
"after",
"anytime"
]
},
"lock": {
"title": "Locked timewindow",
"description": "This boolean is used to determine if the timewindow is strict. If 'lock' is 'true', the timewindow will be highlighted for the users.",
"type": [
"boolean"
]
}
}
},
"comments": {
"title": "Comments",
"description": "Any comments related to the pickup location.",
"type": [
"string"
]
}
}
},
"destination": {
"type": "object",
"properties": {
"companyName": {
"title": "Company name",
"description": "Name of the company where the goods are to be delivered. - Can be used for the customers name in case of a B2C customer.",
"type": [
"string"
]
},
"attention": {
"title": "Attention",
"description": "Name of a contact or department etc.",
"type": [
"string"
]
},
"address": {
"title": "Address",
"description": "The address string with both street and housenumber. We recommend that all address strings are compatible with Google Places. Note that zip and city has been separated.",
"type": [
"string"
]
},
"extraInfo": {
"title": "Extra address info",
"description": "Any address information aside from street and housenumber should be sent in this field. Fx '1st floor right' or 'Gate 5'.",
"type": [
"string"
]
},
"zipCode": {
"title": "Zipcode",
"description": "The zipcode of the address.",
"type": [
"string"
]
},
"city": {
"title": "City",
"description": "The city of the address.",
"type": [
"string"
]
},
"countryCode": {
"title": "Country code",
"description": "ISO-3166-1 alpha-2 country code. Read more at: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2",
"type": [
"string"
]
},
"email": {
"title": "Email",
"description": "Relevant email for the delivery location - often tied to 'attention'.",
"type": [
"string"
]
},
"phone": {
"title": "Phone",
"description": "Phonenumber consisting of a prefix and a phonenumber in separate fields. Often tied to 'attention'.",
"type": "object",
"properties": {
"prefix": {
"type": [
"number"
]
},
"number": {
"type": [
"number"
]
}
}
},
"timeWindow": {
"title": "Timewindow",
"description": "Times should ALWAYS be UTC. Here is defined a window for the delivery to occur. It consists of start time and an end time. If set, both dates MUST be the same date. Only the times can differ. A timewindow can be 'locked'. If there is no timewindow, set 'timeType' to be 'anytime'.",
"type": "object",
"properties": {
"start": {
"title": "Start of timewindow",
"description": "Must be in UTC. Should be the same date as 'end', and MUST be same or lower than 'end'. Use this if 'timeType' is either 'after' or 'between'.",
"type": [
"string"
],
"format": "date-time"
},
"end": {
"title": "End of timewindow",
"description": "Must be in UTC. Should be the same date as 'start', and MUST be same or higher than 'start'. Use this if 'timeType' is either 'before' or 'between'.",
"type": [
"string"
],
"format": "date-time"
},
"timeType": {
"title": "Timetype",
"description": "Used to define whether the given time is the following: 'between' indicates that the timewindow is between 'start' and 'end'. 'before' indicates that the timewindow is before 'end'. 'after' indicates that the timewindows is after 'start'. 'anytime' indicates there is no timewindow.",
"type": [
"string"
],
"enum": [
"between",
"before",
"after",
"anytime"
]
},
"lock": {
"title": "Locked timewindow",
"description": "This boolean is used to determine if the timewindow is strict. If 'lock' is 'true', the timewindow will be highlighted for the users.",
"type": [
"boolean"
]
}
}
},
"comments": {
"title": "Comments",
"description": "Any comments related to the delivery location.",
"type": [
"string"
]
}
}
},
"customFields": {
"additionalProperties": true,
"type": "object",
"properties": {}
},
"cargo": {
"title": "Cargo",
"description": "An array of cargo-items. MUST exist with at least 1 item.",
"type": "array",
"items": [
{
"type": "object",
"required": [
"type",
"amount"
],
"properties": {
"cargoReference": {
"title": "Cargo reference ID",
"description": "A reference ID field for the creator to enter an unique cargo ID if one exists - to track that specific item. This makes it possible to update status of the item in the creators own system.",
"type": [
"string"
]
},
"cargoNr": {
"title": "Cargo Number",
"description": "Reference code, used for a specific code or type of goods within the creators own system.",
"type": [
"string"
]
},
"description": {
"title": "Cargo description",
"description": "Human readable description of the cargo item.",
"type": [
"string"
]
},
"type": {
"title": "Cargo type",
"description": "Type of cargo within the Wuxus system. Can only be one of a collection of values - see enum.",
"type": [
"string"
],
"enum": [
"colli",
"pallet",
"cage"
]
},
"amount": {
"title": "Amount of the cargo item",
"description": "This is the amount of the item. Recommended only if there is no unique item ID/'cargoReference'.",
"type": [
"number"
]
},
"weight": {
"title": "Weight in kg",
"description": "Weight of the item in kilograms - pr. item, meaning that 'amount' will affect the total.",
"type": [
"number"
]
},
"volume": {
"title": "Volume in cubic meters",
"description": "Volume of the item in cubic meters - pr. item, meaning that 'amount' will affect the total.",
"type": [
"number"
]
},
"dimensions": {
"title": "Dimensions in centimeters",
"description": "Dimensions of the item in centimeters - pr. item.",
"type": "object",
"properties": {
"height": {
"title": "Height in centimeters",
"description": "Height of the item in centimeters - pr. item.",
"type": [
"number"
]
},
"width": {
"title": "Width in centimeters",
"description": "Width of the item in centimeters - pr. item.",
"type": [
"number"
]
},
"length": {
"title": "Length in centimeters",
"description": "Length of the item in centimeters - pr. item.",
"type": [
"number"
]
}
}
},
"barcode": {
"title": "Unique barcode for this item",
"description": "This is a unique item barcode, used for scanning of unique items. Item amount is not recommended to be higher than 1, when using this.",
"type": [
"string"
]
},
"services": {
"title": "Services",
"description": "A list of pre-defined services. These are various services tied to the item. Fx delivery services such as 'carry up' or installation services. Find the complete list under '3. Property descriptions --> cargo.services' here: https://docs.wuxus.com/#2a03b25f-3720-bc02-ba65-9e5123ee59bd",
"type": "array",
"items": [
{
"type": "object",
"properties": {
"serviceId": {
"type": [
"string"
],
"pattern": "^([a-f0-9]{24}|[a-f0-9]{24}|[A-F0-9]{12}|[A-F0-9]{12})$"
}
}
}
]
}
}
}
]
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment