Customers
in package
* Customers resource for managing customer records.
Request arrays use the API's documented snake_case field names. Successful responses
are returned as immutable values from the corresponding singular resource namespace.
Table of Contents
Methods
- __construct() : mixed
- Creates the customers resource client.
- create() : Customer
- Create a customer (POST /customers/create).
- lookup() : Customer
- Lookup a customer by ID (POST /customers/lookup).
- page() : Page
- Page through customers (POST /customers/page).
- search() : ResourceSearchPage
- Search customer profiles with a typed resource-local query.
- update() : Customer
- Update supplied fields on a customer record (POST /customers/update).
Methods
__construct()
Creates the customers resource client.
public
__construct(HttpClient $http) : mixed
Parameters
- $http : HttpClient
-
Shared authenticated HTTP transport used by this resource client.
create()
Create a customer (POST /customers/create).
public
create(CreateRequest|array<string, mixed> $payload) : Customer
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : CreateRequest|array<string, mixed>
-
Typed request or compatible wire fields.
Return values
Customer —The created customer.
lookup()
Lookup a customer by ID (POST /customers/lookup).
public
lookup(string $customerId) : Customer
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $customerId : string
-
Unique identifier of the customer.
Return values
Customer —The requested customer.
page()
Page through customers (POST /customers/page).
public
page([array<string, mixed> $payload = [] ]) : Page
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed> = []
-
Request fields keyed by the documented
snake_caseAPI names.
Return values
Page —A typed page of matching customers.
search()
Search customer profiles with a typed resource-local query.
public
search(ResourceSearchRequest $payload) : ResourceSearchPage
Parameters
- $payload : ResourceSearchRequest
Return values
ResourceSearchPageupdate()
Update supplied fields on a customer record (POST /customers/update).
public
update(UpdateRequest|array<string, mixed> $payload[, string|null $idempotencyKey = null ]) : Customer
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : UpdateRequest|array<string, mixed>
-
Typed request or compatible wire fields.
- $idempotencyKey : string|null = null
-
Optional idempotency key for safely retrying the same logical write.
Return values
Customer —The updated customer.