Customer Company

The Customer Company API allows you to manage the customers company details.


The Customer Company Resource

Properties

  • Name
    name
    Required
    Type
    string | null
    Description

    The name of the company for this customer. If this is a retail customer, this value will be null.

  • Name
    type
    Required
    Type
    string | null
    Description

    The type of company. Will be one of undefined, private, sole-trader, limited-company, llp, partnership, plc, charity, local-authority. If this is a retail customer, this value will be null.

Customer Company Resource

{
  "name": "ITC Compliance",
  "type": "limited-company"
}

GET/v2/customers/:customer_id/company

Retrieve Customer Company

Will retrieve the company details recorded for the customer. If this is a retail customer, properties in the payload will be null.

URL Parameters

  • Name
    customer_id
    Required
    required
    Type
    integer
    Description

    ID of the customer to retrieve the company details of

Error Codes

Status Description
404 The requested customer could not be found.

Request

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

private ApexV3SdkInterface $sdk;

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

Response

{
  "data": {
    "name": "ITC Compliance",
    "street": "limited-company"
  }
}

PUT/v2/customers/:customer_id/company

Update Customer Address

Will attempt to update the customers company details. Only values provided in the payload will be updated.

URL Parameters

  • Name
    customer_id
    Required
    required
    Type
    integer
    Description

    ID of the customer to update the company details of

Payload

  • Name
    name
    Required
    Type
    string | null
    Description

    Name of the customers company.

  • Name
    type
    Required
    Type
    string
    Description

    The type of company or customer. Must be one of undefined, private, sole-trader, limited-company, llp, partnership, plc, charity, local-authority. If this is a retail sale, provide private.

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

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

private ApexV3SdkInterface $sdk;

$response = $this->sdk
  ->v2(new Machine())
  ->customer(1)
  ->company()
  ->update([
    'name' => 'ITC Compliance',
    'type' => 'limited-company'
  ]);

Response

{
  "data": {
    "name": "ITC Compliance",
    "type": "limited-company",
  }
}