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} |
| 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 This endpoint does not accept an idempotency key. If you accidentally create a duplicate customer, you can delete it with the DeleteCustomer endpoint.
| 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.
| 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.
| 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)
Lists a business's customers.
| Name | Type | Notes | Default Value |
|---|---|---|---|
| cursor | 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]
UpdateCustomerResponse update_customer(customer_id, body)
Updates the details of an existing customer. 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]