Customer#

Note

Viewing documentation for the current version v1.

The required Protobuf definitions can be downloaded here:

CustomerService#

The customer service to manage customers.

GetCustomer#

rpc GetCustomer(GetCustomerRequest) returns (GetCustomerResponse)

Get a customer by ID.

Fails with NOT_FOUND with the reason CUSTOMER_NOT_FOUND if the customer does not exist.

ListCustomers#

rpc ListCustomers(ListCustomersRequest) returns (ListCustomersResponse)

List customers.

Fails with INVALID_ARGUMENT with the following reasons:

  • INVALID_PAGE_SIZE if the page_size is less than zero.

  • INVALID_PAGE_TOKEN if the page_token does not match previous requests.

CreateCustomer#

rpc CreateCustomer(CreateCustomerRequest) returns (CreateCustomerResponse)

Create a customer.

Fails with INVALID_ARGUMENT with the following reasons:

  • INVALID_PHONE_NUMBER if the provided phone number is invalid.

  • INVALID_GIVEN_NAME if the provided given name is longer than 100 characters.

  • INVALID_FAMILY_NAME if the provided family name is longer than 100 characters.

  • INVALID_NAME if neither a given name nor family name is provided.

  • INVALID_LANGUAGE_CODE if the provided language code is unknown or invalid.

  • INVALID_EMAIL_ADDRESS if the provided email address is longer than 250 characters or is invalid.

UpdateCustomer#

rpc UpdateCustomer(UpdateCustomerRequest) returns (UpdateCustomerResponse)

Updates a customer.

Fails with NOT_FOUND with the reason CUSTOMER_NOT_FOUND if the customer does not exist.

Fails with INVALID_ARGUMENT with the following reasons:

  • INVALID_PHONE_NUMBER if the provided phone number is invalid.

  • INVALID_GIVEN_NAME if the provided given name is longer than 100 characters.

  • INVALID_FAMILY_NAME if the provided family name is longer than 100 characters.

  • INVALID_NAME if neither a given name or family name is provided.

  • INVALID_LANGUAGE_CODE if the provided language code is unknown or invalid.

  • INVALID_EMAIL_ADDRESS if the provided email address is longer than 250 characters or is invalid.

DeleteCustomer#

rpc DeleteCustomer(DeleteCustomerRequest) returns (DeleteCustomerResponse)

Deletes a customer.

Fails with NOT_FOUND with the reason CUSTOMER_NOT_FOUND if the customer does not exist.

ListCustomerFlags#

rpc ListCustomerFlags(ListCustomerFlagsRequest) returns (ListCustomerFlagsResponse)

List customer flags.

Fails with NOT_FOUND with the reason CUSTOMER_NOT_FOUND if the customer does not exist.

Fails with INVALID_ARGUMENT with the following reasons:

  • INVALID_PAGE_SIZE if the page_size is less than zero.

  • INVALID_PAGE_TOKEN if the page_token does not match previous requests.

AddCustomerFlag#

rpc AddCustomerFlag(AddCustomerFlagRequest) returns (AddCustomerFlagResponse)

Adds a customer flag. Succeeds if the flag already exists. Flags may be configured with your service configuration manager.

Fails with NOT_FOUND with the reason CUSTOMER_NOT_FOUND if the customer does not exist.

Fails with INVALID_ARGUMENT with the reason INVALID_FLAG if the provided flag is not available or read-only.

RemoveCustomerFlag#

rpc RemoveCustomerFlag(RemoveCustomerFlagRequest) returns (RemoveCustomerFlagResponse)

Removes a customer flag. Succeeds if the flag does not exist.

Fails with NOT_FOUND with the reason CUSTOMER_NOT_FOUND if the customer does not exist.

Messages#

AddCustomerFlagRequest#

The request to add a flag to a customer.

Field

Type

Description

customer_id

string

The ID of the customer.

flag

string

The flag to add.

AddCustomerFlagResponse#

The response indicating a flag was added to a customer.

This message is an empty message and has no fields. The JSON representation is {}.

CreateCustomerRequest#

The request to create a customer.

Field

Type

Description

email_address

string

The customer’s e-mail address. The email address is expected to be confirmed before. Used by customer support to contact the customer. The maximum allowed length is 250 characters.

phone_number

string

The customer’s phone number. The phone number is expected to be confirmed before. Used by customer support to contact the customer. The phone number must follow the E.164 format. For example ‘+4930726219941’.

given_name

string

The customer’s given name. The maximum allowed length is 100 characters. Empty strings are allowed. If empty, the family name must not be empty.

family_name

string

The customer’s family name. The maximum allowed length is 100 characters. Empty strings are allowed. If empty, the given name must not be empty.

language_code

string

The customer’s preferred language. The language code needs to follow the IETF BCP-47 format. For example ‘en’ or ‘de’.

CreateCustomerResponse#

The response containing the created customer.

Field

Type

Description

customer

Customer

The created customer.

Customer#

A customer.

Field

Type

Description

id

string

The ID of the customer.

email_address

string

The customer’s e-mail address. The email address is expected to be confirmed before. Used by customer support to contact the customer. The maximum allowed length is 250 characters.

phone_number

string

The customer’s phone number. The phone number is expected to be confirmed before. Used by customer support to contact the customer. The phone number must follow the E.164 format. For example ‘+4930726219941’.

given_name

string

The customer’s given name. The maximum allowed length is 100 characters. Empty strings are allowed. If empty, the family name must not be empty.

family_name

string

The customer’s family name. The maximum allowed length is 100 characters. Empty strings are allowed. If empty, the given name must not be empty.

language_code

string

The customer’s preferred language. The language code needs to follow the IETF BCP-47 format.

DeleteCustomerRequest#

The request to delete a customer.

Field

Type

Description

id

string

The ID of the customer to delete.

DeleteCustomerResponse#

The response indicating the customer was deleted.

This message is an empty message and has no fields. The JSON representation is {}.

GetCustomerRequest#

The request to get a customer by ID.

Field

Type

Description

id

string

The ID of the customer.

GetCustomerResponse#

The response containing the requested customer.

Field

Type

Description

customer

Customer

The customer with the given ID.

ListCustomerFlagsRequest#

The request to list the flags for a customer.

Field

Type

Description

customer_id

string

The ID of the customer.

page_size

optional int32

The maximum number of customer flags to return. The service may return fewer than this value. If unspecified or set to zero, at most 50 customer flags will be returned. Negative values won’t be accepted. The maximum value is 1000; values above 1000 will be coerced to 1000.

page_token

optional string

A page token, received from a previous ListCustomerFlags call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListCustomerFlags must match the call that provided the page token.

ListCustomerFlagsResponse#

The response to list the flags for a customer.

Field

Type

Description

flags

repeated string

The active flags for the customer.

next_page_token

optional string

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

ListCustomersRequest#

The request to list customers.

Field

Type

Description

page_size

optional int32

The maximum number of customers to return. The service may return fewer than this value. If unspecified or set to zero, at most 50 customers will be returned. Negative values won’t be accepted. The maximum value is 1000; values above 1000 will be coerced to 1000.

page_token

optional string

A page token, received from a previous ListCustomers call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListCustomers must match the call that provided the page token.

ListCustomersResponse#

The response containing the customers.

Field

Type

Description

customers

repeated Customer

The customers.

next_page_token

optional string

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

RemoveCustomerFlagRequest#

The request to remove a flag from a customer.

Field

Type

Description

customer_id

string

The ID of the customer.

flag

string

The flag to remove.

RemoveCustomerFlagResponse#

The response indicating a flag was removed from a customer.

This message is an empty message and has no fields. The JSON representation is {}.

UpdateCustomerRequest#

The request to update a customer.

Field

Type

Description

customer

Customer

The updated customer.

UpdateCustomerResponse#

The response containing the updated customer.

Field

Type

Description

customer

Customer

The updated customer.