REST API v2.15

Reason Codes

Collection of reason codes for warehouse transactions, actions and events.

Get Reason Codes

Endpoint

GET reasoncodes

Parameters

type

Filter on type. ValueDescription10ManualIn20ManualOut30Sales40Refund50StockTaking60Move70ShipmentIn80ShipmentOut

start

The index of the item to start fromDefault: 0

num

The number of items returnedDefault: 10

fields

Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in reasoncode.

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an envelope with items of type reasoncode.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/reasoncodes.json?num=2

Response

{ "totalcount": 2, "items": [ { "reasoncodeid": 1, "type": 10, "reasoncode": "101", "name": "Reclaim" }, { "reasoncodeid": 2, "type": 10, "reasoncode": "102", "name": "Guarantee" } ] }

Add Reason Code

Endpoint

POST reasoncodes

Request body

See reasoncode for fields.
Required fields:
typereasoncode

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns reasoncodeid if successful.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/reasoncodes.json { "type": 10, "reasoncode": "103", "name": "Reclaims" }

Response

3

Get Reason Code

Endpoint

GET reasoncodes/{reasoncodeid}

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an item of type reasoncode.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/reasoncodes/3.json

Response

{ "reasoncodeid": 3, "type": 10, "reasoncode": "103", "name": "Reclaims" }

Update Reason Code

Endpoint

PUT reasoncodes/{reasoncodeid}

Request body

See reasoncode for fields.

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns true if successful.

Example

Request

PUT https://api.mysitoo.com/v2/accounts/1500/reasoncodes/3.json { "name": "Customer Reclaim" }

Response

true

Delete Reason Code

Endpoint

DELETE reasoncodes/{reasoncodeid}

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns true if successful.

Example

Request

DELETE https://api.mysitoo.com/v2/accounts/1500/reasoncodes/3.json

Response

true