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 benull
.
Customer Company Resource
{
"name": "ITC Compliance",
"type": "limited-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
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"
}
}
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, provideprivate
.
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
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",
}
}