squareconnect.apis.customers_api
All endpoints are relative to Square Connect V2 Documentation
Method | HTTP request |
---|---|
create_customer | POST /v2/customers |
create_customer_card | POST /v2/customers/{customer_id}/cards |
delete_customer | DELETE /v2/customers/{customer_id} |
delete_customer_card | DELETE /v2/customers/{customer_id}/cards/{card_id} |
list_customers | GET /v2/customers |
retrieve_customer | GET /v2/customers/{customer_id} |
search_customers | POST /v2/customers/search |
update_customer | PUT /v2/customers/{customer_id} |
CreateCustomerResponse create_customer(body)
Creates a new customer for a business, which can have associated cards on file. You must provide at least one of the following values in your request to this endpoint: - given_name
- family_name
- company_name
- email_address
- phone_number
Name | Type | Notes | Default Value |
---|---|---|---|
body | CreateCustomerRequest |
Assign your Access Token from developer portal to the authorization parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateCustomerCardResponse create_customer_card(customer_id, body)
Adds a card on file to an existing customer. As with charges, calls to CreateCustomerCard
are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the first call. Cards on file are automatically updated on a monthly basis to confirm they are still valid and can be charged.
Name | Type | Notes | Default Value |
---|---|---|---|
customer_id | str | ||
body | CreateCustomerCardRequest |
Assign your Access Token from developer portal to the authorization parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteCustomerResponse delete_customer(customer_id)
Deletes a customer from a business, along with any linked cards on file. When two profiles are merged into a single profile, that profile is assigned a new customer_id
. You must use the new customer_id
to delete merged profiles.
Name | Type | Notes | Default Value |
---|---|---|---|
customer_id | str |
Assign your Access Token from developer portal to the authorization parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteCustomerCardResponse delete_customer_card(customer_id, card_id)
Removes a card on file from a customer.
Name | Type | Notes | Default Value |
---|---|---|---|
customer_id | str | ||
card_id | str |
Assign your Access Token from developer portal to the authorization parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListCustomersResponse list_customers(cursor=cursor, sort_field=sort_field, sort_order=sort_order)
Lists a business's customers.
Name | Type | Notes | Default Value |
---|---|---|---|
cursor | str | [optional] | |
sort_field | str | [optional] | |
sort_order | str | [optional] |
Assign your Access Token from developer portal to the authorization parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RetrieveCustomerResponse retrieve_customer(customer_id)
Returns details for a single customer.
Name | Type | Notes | Default Value |
---|---|---|---|
customer_id | str |
Assign your Access Token from developer portal to the authorization parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SearchCustomersResponse search_customers(body)
Searches the customer profiles associated with a Square account. Calling SearchCustomers without an explicit query parameter returns all customer profiles ordered alphabetically based on given_name
and family_name
.
Name | Type | Notes | Default Value |
---|---|---|---|
body | SearchCustomersRequest |
Assign your Access Token from developer portal to the authorization parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateCustomerResponse update_customer(customer_id, body)
Updates the details of an existing customer. When two profiles are merged into a single profile, that profile is assigned a new customer_id
. You must use the new customer_id
to update merged profiles. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the DeleteCustomerCard endpoint, then create a new one with the CreateCustomerCard endpoint.
Name | Type | Notes | Default Value |
---|---|---|---|
customer_id | str | ||
body | UpdateCustomerRequest |
Assign your Access Token from developer portal to the authorization parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]