For all operations listed below you will need to provide HTTP Request Header Authorization param. For more details see Login/Auth page.
Get the list of addresses
Route: /address
Method: GET
Required query parameters:
customer_id
array of customer IDs. (See Customer section, for more details how to get customer IDs associated with your account)
Example result
{
"entities": [
{
"customer_id": "1",
"company": "Company Name",
"street1": "Street Address 1",
"street2": "Street Address 2",
"postal_code": "12345",
"city": "City",
"state": "State",
"country": "Country",
"branch_id": "0",
"ksmsid": "",
"authorized_email": "",
"id": "1592",
"latitude": null,
"longitude": null,
"pp_account": "",
"customer_name": "Customer Name",
"customer_account": "Customer Account Number",
"branch_name": "Name of the Branch"
},
{
...
}
...
"result": true
In the address
object:
customer_id
: Internal id of the customer objectcompany
: Name of the companystreet1
: Street Addressstreet2
: Apt, Suite, Building #, etcpostal_code
: Postal codecity
: Name of the citystate
: Name of the statecountry
: Name of the countrybranch_id
: Internal branch idbranch_name
: Branch nameauthorized_email
: Email address of the authorized personid
: internal object identifierlatitude
: Latitude coordinate of the addresslongitude
: Longitude coordinate of the addresscustomer_name
: Name of the customercustomer_account
: Account number of the customer
Get address by internal ID
Route: /address/{internal_id}
Method: GET
Example result
{
"entity": {
"customer_id": "1",
"company": "Company Name",
"street1": "Street Address 1",
"street2": "Street Address 2",
"postal_code": "12345",
"city": "City",
"state": "State",
"country": "Country",
"branch_id": "0",
"ksmsid": "",
"authorized_email": "",
"id": "1592",
"latitude": null,
"longitude": null,
"pp_account": "",
"customer_name": "Customer Name",
"customer_account": "Customer Account Number",
"branch_name": "Name of the Branch"
},
"result": true
}
Adding new address object
Route: /address
Method: POST
Data requirements & limitations
- customer_ids (array[int...]) (required)- array of customer_ids.
- company (required) - String with length at most 64 characters.
- street1 - String with length at most 64 characters.
- street2 - String with length at most 64 characters.
- postal_code - String with length at most 16 characters.
- city - String with length at most 64 characters.
- state - String with length at most 64 characters.
- country - String with length at most 64 characters.
- branch_id - Unsigned integer between 0 and 4294967295.
- latitude - Decimal in valid latitude range.
- longitude - Decimal in valid longitude range.
- ksmsid - String with length at most 16 characters.
- authorized_email - String in email format and at most 191 characters.
API response examples:
RESPONSE 200 - OK, SUCCESS
{
"msg": "Successfully created entity.",
"id": "1",
"result": true
}
RESPONSE 200 - OK, FAILURE (EMPTY REQUEST)
In case if you don't provide any field, you'll get the following error:
{
"error": "Nothing sent for request.",
"result": false
}
OTHER FAILURE RESPONSES MIGHT RETURN
- errors:
- field_name: Field is required.
- field_name: validation error, when field does not validate against the rules listed above
- result: false
Updating existing address object
Route: /address/{internal_id}
Method: POST
Data requirements & limitations
- customer_ids (array[int...]) (required) - array of customer_ids.
- company (required) - String with length at most 64 characters.
- street1 - String with length at most 64 characters.
- street2 - String with length at most 64 characters.
- postal_code - String with length at most 16 characters.
- city - String with length at most 64 characters.
- state - String with length at most 64 characters.
- country - String with length at most 64 characters.
- branch_id - Unsigned integer between 0 and 4294967295.
- latitude - Decimal in valid latitude range.
- longitude - Decimal in valid longitude range.
- ksmsid - String with length at most 16 characters.
- authorized_email - String in email format and at most 191 characters.
API response examples:
RESPONSE 200 - OK, SUCCESS
{
"msg": "Successfully updated entity.",
"result": true
}
RESPONSE 200 - OK, FAILURE (EMPTY REQUEST)
In case if you don't provide any field, you'll get the following error:
{
"error": "Nothing sent for request.",
"result": false
}
OTHER FAILURE RESPONSES MIGHT RETURN
- errors:
- field_name: Field is required.
- field_name: validation error, when field does not validate against the rules listed above
- result: false
Deleting the existing address object
Route: /address/{internal_id}/delete
Method: GET
API response examples:
RESPONSE 200 - OK, SUCCESSFULLY DELETED ENTITY
{
"msg": "Entity has been successfully deleted.",
"result": false
}
RESPONSE 200 - OK, ENTITY NOT FOUND
{
"msg": "Entity not found.",
"result": false
}