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 object
  • company: Name of the company
  • street1: Street Address
  • street2: Apt, Suite, Building #, etc
  • postal_code: Postal code
  • city: Name of the city
  • state: Name of the state
  • country: Name of the country
  • branch_id: Internal branch id
  • branch_name: Branch name
  • authorized_email: Email address of the authorized person
  • id: internal object identifier
  • latitude: Latitude coordinate of the address
  • longitude: Longitude coordinate of the address
  • customer_name: Name of the customer
  • customer_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
}