beach-day
Version:
API integration testing as fun as a day on the beach
1,059 lines (1,058 loc) • 329 kB
JSON
{
"swagger": "2.0",
"info": {
"title": "PAXI API Documentation",
"version": "1",
"description": "\n**Property Naming Conventions**\n-----------------\n\n**dropLabelBarcode** We know this is a drop label (validated)\n\n**storageLocationBarcode** We know this is a storage location (validated)\n\n**parcelBarcode** We know this could be any one of the related parcel barcodes, which include drop label, courier parcel number, courier parcel waybill number, QR code (validated)\n\n**courierCollectionManifestBarcode** We know this is a courier collection manifest barcode (validated)\n\n**courierDeliveryManifestBarcode** We know this is a courier delivery manifest barcode (validated)\n\n**errorBarcode** We know this didn't match anything we were looking for client side (coming from the scanner in the UI)\n\n**barcode** We have no idea what kind of barcode we're dealing with yet (coming from the scanner in the UI)\n\n-----------------\n\n**Error Codes**\n-----------------\n\n\n**0001** - Unexpected Error: Runtime error only - never expected\n\n**1000** - Service offline\n\n**1008** - Login Error: Error with username or pin\n\n**1009** - Permissions Error\n\n**1010** - Old pin invalid\n\n**1011** - Drop Label Already In Use\n\n**1012** - Invalid Parcel State Transition\n\n**1013** - Storage location has been decommissioned\n\n**1015** - Create User Error: Staff number already in use\n\n**1016** - Delete User Error: User does not exist\n\n**1017** - Invalid pin used for existing user\n\n**1018** - Existing user is not a manager\n\n**1019** - Node is not assigned to a company\n\n\n\n-----------------\n\n**WSO2 Faults**\n-----------------\n\n\n**900901** - Invalid Credentials - Invalid Authentication information provided\n\n\n\n-----------------\n\n**WSO2 & OAuth2**\n-----------------\n\nThis API has been integrated with WSO2's API Manager and it's own OAuth2 implementation.\n\n**IMPORTANT NOTE:** WSO2 implements it's own error codes and error response format. The error codes can be found here: https://docs.wso2.com/display/AM1100/Error+Handling\n\nThe JSON error response can come back on any of the calls below and looks like this: {\"fault\":{\"code\":<errorCode>,\"message\":\"<message>\",\"description\":\"<Desciption>\"}}\n\n-----------------\n\n**Format: date-time**\n-----------------\n\nAll dates returned in this API must follow the format: Full ISO-8601 \n- Complete date plus hours, minutes, seconds and a decimal fraction of a second \n- YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) \n- Please see: https://www.w3.org/TR/NOTE-datetime\n\n-----------------\n"
},
"paths": {
"/startup/fetchStartupData": {
"post": {
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/StartupData"
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Returns the startup data required when the app starts.",
"tags": [
"00 - Startup"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"uuid"
],
"properties": {
"uuid": {
"type": "string",
"description": "The device's Universally Unique Identifier. On Android this will be the IMEI number. On iOS this will be the device UUID exposed by Cordova"
}
}
}
}
]
}
},
"/startup/fetchCompanies": {
"get": {
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Company"
}
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Returns the companies supported",
"tags": [
"00 - Startup"
]
}
},
"/startup/fetchVersions": {
"get": {
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/VersionHolder"
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Returns the version of each server system component",
"tags": [
"00 - Startup"
]
}
},
"/auth/registerDevice": {
"post": {
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/StartupData"
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n1017 - Invalid pin used for existing user\n\n1018 - Existing user is not a manager\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000",
"1017",
"1018"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n1017 - Invalid pin used for existing user\n\n1018 - Existing user is not a manager\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Sends a request to register a new device and returns startup data.\n\nUpon calling register some validations will need to occur. If the staffNumber matches a user that is\nalready in the system 2 validations should occur. First the pin should be checked against that users pin\nand second if the user is not a STORE_MANAGER the request should be rejected.\n\nIf the request is successful - the data sent in this request should generate an admin console ticket, the admin console user will then\nuse this data to create the required user & register the device and link it to a node code.",
"tags": [
"01 - Auth"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"uuid",
"firstName",
"lastName",
"cellNumber",
"storeNumber",
"staffNumber",
"pin",
"companyId"
],
"properties": {
"uuid": {
"type": "string",
"description": "The device's Universally Unique Identifier. On Android this will be the IMEI number. On iOS this will be the device UUID exposed by Cordova"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"cellNumber": {
"type": "string"
},
"storeNumber": {
"type": "string"
},
"staffNumber": {
"type": "string"
},
"pin": {
"type": "string"
},
"companyId": {
"type": "number"
},
"longitude": {
"type": "number",
"description": "The device's current longitude"
},
"latitude": {
"type": "number",
"description": "The device's current latitude"
}
}
}
}
]
}
},
"/auth/validateLocation": {
"post": {
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/LocationStatus"
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Validates a location to check if it is within the radius of the registered location",
"tags": [
"01 - Auth"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"nodeId",
"uuid",
"longitude",
"latitude"
],
"properties": {
"nodeId": {
"type": "number",
"description": "The device's assigned nodeId"
},
"uuid": {
"type": "string",
"description": "The device's Universally Unique Identifier. On Android this will be the IMEI number. On iOS this will be the device UUID exposed by Cordova"
},
"longitude": {
"type": "number",
"description": "The device's current longitude"
},
"latitude": {
"type": "number",
"description": "The device's current latitude"
}
}
}
}
]
}
},
"/auth/login": {
"post": {
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/User"
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n1008 - Login Error: Error with username or pin\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000",
"1008"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n1008 - Login Error: Error with username or pin\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Logs in a user or returns an error. Server creates a sessions cookie that\nwill be sent with all requests",
"tags": [
"01 - Auth"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"nodeId",
"deviceId",
"username",
"pin"
],
"properties": {
"nodeId": {
"type": "number",
"description": "The device's assigned nodeId"
},
"deviceId": {
"type": "string",
"description": "The users device id string"
},
"username": {
"type": "string"
},
"pin": {
"type": "string"
}
}
}
}
]
}
},
"/auth/logout": {
"post": {
"responses": {
"200": {
"description": "Returned when the user has been sucessfully logged out"
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Logs out the user. Server clears the session",
"tags": [
"01 - Auth"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"nodeId",
"userId"
],
"properties": {
"nodeId": {
"type": "number",
"description": "The device's assigned nodeId"
},
"userId": {
"type": "number",
"description": "The logged in user's id"
}
}
}
}
]
}
},
"/parcel/fetchParcel": {
"post": {
"responses": {
"200": {
"description": "Returns null if nothing is found. Returns all the parcels found for the barcode or customerReferenceNumber (there may be duplicate customer reference numbers)",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Parcel"
},
"x-isnullable": true
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Returns the requested parcel",
"tags": [
"02 - Parcel"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"nodeId",
"userId"
],
"properties": {
"nodeId": {
"type": "number",
"description": "The device's assigned nodeId"
},
"userId": {
"type": "number",
"description": "The logged in user's id"
},
"barcode": {
"type": "string"
},
"customerReferenceNumber": {
"type": "string"
}
}
}
}
]
}
},
"/parcel/fetchParcelByCustomerCollectionCode": {
"post": {
"responses": {
"200": {
"description": "Returns null if nothing is found",
"schema": {
"$ref": "#/definitions/Parcel",
"x-isnullable": true
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Returns the requested parcel",
"tags": [
"02 - Parcel"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"nodeId",
"userId",
"customerCollectionCode"
],
"properties": {
"nodeId": {
"type": "number",
"description": "The device's assigned nodeId"
},
"userId": {
"type": "number",
"description": "The logged in user's id"
},
"customerCollectionCode": {
"type": "string"
}
}
}
}
]
}
},
"/parcel/validateBarcode": {
"post": {
"responses": {
"200": {
"description": "",
"schema": {
"type": "object",
"required": [
"valid"
],
"properties": {
"valid": {
"type": "boolean"
}
}
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "Validates the supplied barcode number to make sure it's a legitimate parcel barcode in the system. Used in the PutAway process as an example.",
"tags": [
"02 - Parcel"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"nodeId",
"userId",
"barcode"
],
"properties": {
"nodeId": {
"type": "number",
"description": "The device's assigned nodeId"
},
"userId": {
"type": "number",
"description": "The logged in user's id"
},
"barcode": {
"type": "string"
}
}
}
}
]
}
},
"/parcel/fetchStorageLocations": {
"post": {
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/StorageLocation"
},
"x-isnullable": true
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [
"fault",
"message"
],
"properties": {
"fault": {
"type": "string",
"enum": [
"900901"
],
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n"
},
"message": {
"type": "string"
}
}
}
},
"500": {
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n",
"schema": {
"required": [
"responseCode",
"responseMessage"
],
"properties": {
"responseCode": {
"type": "string",
"enum": [
"0001",
"1000"
],
"description": "\n\n0001 - Unexpected Error: Runtime error only - never expected\n\n1000 - Service offline\n\n"
},
"responseMessage": {
"type": "string"
}
}
}
}
},
"security": [
{
"AccessToken": [
"s1"
]
}
],
"description": "This is used to fetch the applicable storage locations for the supplied parcel barcode number",
"tags": [
"02 - Parcel"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "application/json",
"required": true,
"schema": {
"type": "object",
"required": [
"nodeId",
"userId",
"parcelId"
],
"properties": {
"nodeId": {
"type": "number",
"description": "The device's assigned nodeId"
},
"userId": {
"type": "number",
"description": "The logged in user's id"
},
"parcelId": {
"type": "number"
}
}
}
}
]
}
},
"/parcel/fetchParcelTracking": {
"post": {
"responses": {
"200": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/ParcelTrackingInfo"
},
"x-isnullable": true
}
},
"401": {
"description": "\n\n900901 - Invalid Credentials - Invalid Authentication information provided\n\n",
"schema": {
"required": [