Skip to content

Latest commit

 

History

History
181 lines (106 loc) · 6.25 KB

File metadata and controls

181 lines (106 loc) · 6.25 KB

CustomersApi

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}

create_customer

CreateCustomerResponse create_customer(body)

Description

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.

Parameters

Name Type Notes Default Value
body CreateCustomerRequest

Return type

CreateCustomerResponse

Authorization

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]

create_customer_card

CreateCustomerCardResponse create_customer_card(customer_id, body)

Description

Adds a card on file to an existing customer.

Parameters

Name Type Notes Default Value
customer_id str
body CreateCustomerCardRequest

Return type

CreateCustomerCardResponse

Authorization

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]

delete_customer

DeleteCustomerResponse delete_customer(customer_id)

Description

Deletes a customer from a business, along with any linked cards on file.

Parameters

Name Type Notes Default Value
customer_id str

Return type

DeleteCustomerResponse

Authorization

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]

delete_customer_card

DeleteCustomerCardResponse delete_customer_card(customer_id, card_id)

Description

Removes a card on file from a customer.

Parameters

Name Type Notes Default Value
customer_id str
card_id str

Return type

DeleteCustomerCardResponse

Authorization

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]

list_customers

ListCustomersResponse list_customers(cursor=cursor)

Description

Lists a business's customers.

Parameters

Name Type Notes Default Value
cursor str [optional]

Return type

ListCustomersResponse

Authorization

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]

retrieve_customer

RetrieveCustomerResponse retrieve_customer(customer_id)

Description

Returns details for a single customer.

Parameters

Name Type Notes Default Value
customer_id str

Return type

RetrieveCustomerResponse

Authorization

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]

update_customer

UpdateCustomerResponse update_customer(customer_id, body)

Description

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.

Parameters

Name Type Notes Default Value
customer_id str
body UpdateCustomerRequest

Return type

UpdateCustomerResponse

Authorization

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]