Customer Address

The Customer Address API allows you to manage customers recorded addresses.


The Customer Address Resource

Properties

  • Name
    property_name_number
    Required
    Type
    string | null
    Description

    The name or number of the property.

  • Name
    street
    Required
    Type
    string | null
    Description

    The street of the property.

  • Name
    town
    Required
    Type
    string | null
    Description

    The town of the property.

  • Name
    county
    Required
    Type
    string | null
    Description

    The county of the property.

  • Name
    postcode
    Required
    Type
    string | null
    Description

    The postcode of the property.

Customer Address Resource

{
  "property_name_number": "Unit 3",
  "street": "The Brooms",
  "town": "Bristol",
  "county": "South Gloucestershire",
  "postcode": "BS16 7FH"
}

GET/v2/customers/:customer_id/address

Retrieve Customer Address

Will retrieve the primary address recorded for the customer. If no address is recorded, all properties in the payload will be null.

URL Parameters

  • Name
    customer_id
    Required
    required
    Type
    integer
    Description

    ID of the customer to retrieve the primary address of

Error Codes

Status Description
404 The requested customer could not be found.

Request

GET
/v2/customers/:customer_id/address
use Compliance\Sdk\ApexV3\Contracts\ApexV3SdkInterface;
use Compliance\Sdk\Authentication\Types\Machine;

private ApexV3SdkInterface $sdk;

$response = $this->sdk
  ->v2(new Machine())
  ->customer(1)
  ->address()
  ->get();

Response

{
  "data": {
    "property_name_number": "Unit 3",
    "street": "The Brooms",
    "town": "Bristol",
    "county": "South Gloucestershire",
    "postcode": "BS16 7FH"
  }
}

POST/v2/customers/:customer_id/address

Update Customer Address

Will attempt to update the customers primary address. All existing address values previously provided will be replaced.

URL Parameters

  • Name
    customer_id
    Required
    required
    Type
    integer
    Description

    ID of the customer to update the address of

Payload

  • Name
    property_name_number
    Required
    required
    Type
    string | null
    Description

    The property name or number to set for the customer. This is a required field, but can provide null.

  • Name
    street
    Required
    Type
    string | null
    Description

    The street of the property

  • Name
    town
    Required
    Type
    string | null
    Description

    The town of the property

  • Name
    county
    Required
    Type
    string | null
    Description

    The county of the property

  • Name
    postcode
    Required
    required
    Type
    string | null
    Description

    The postcode of the property. This is a required field, but can provide null.

Error Codes

Status Description
404 The requested customer could not be found.
422 The data provided in the payload was invalid. See errors for more details.

Request

POST
/v2/customers/:customer_id/address
use Compliance\Sdk\ApexV3\Contracts\ApexV3SdkInterface;
use Compliance\Sdk\Authentication\Types\Machine;

private ApexV3SdkInterface $sdk;

$response = $this->sdk
  ->v2(new Machine())
  ->customer(1)
  ->address()
  ->update(
    'Unit 3',
    'Thr Brooms',
    'Bristol',
    'South Gloucestershire',
    'BS16 7FH'
  );

Response

{
  "data": {
    "property_name_number": "Unit 3",
    "street": "The Brooms",
    "town": "Bristol",
    "county": "South Gloucestershire",
    "postcode": "BS16 7FH"
  }
}