All URIs are relative to https://connect.squareup.com/
Method | HTTP request | Description |
---|---|---|
AddGroupToCustomer | Put /v2/customers/{customer_id}/groups/{group_id} | AddGroupToCustomer |
CreateCustomer | Post /v2/customers | CreateCustomer |
CreateCustomerCard | Post /v2/customers/{customer_id}/cards | CreateCustomerCard |
DeleteCustomer | Delete /v2/customers/{customer_id} | DeleteCustomer |
DeleteCustomerCard | Delete /v2/customers/{customer_id}/cards/{card_id} | DeleteCustomerCard |
ListCustomers | Get /v2/customers | ListCustomers |
RemoveGroupFromCustomer | Delete /v2/customers/{customer_id}/groups/{group_id} | RemoveGroupFromCustomer |
RetrieveCustomer | Get /v2/customers/{customer_id} | RetrieveCustomer |
SearchCustomers | Post /v2/customers/search | SearchCustomers |
UpdateCustomer | Put /v2/customers/{customer_id} | UpdateCustomer |
AddGroupToCustomerResponse AddGroupToCustomer(ctx, customerId, groupId) AddGroupToCustomer
Adds a group membership to a customer. The customer is identified by the customer_id
value and the customer group is identified by the group_id
value.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerId | string | The ID of the customer to add to a group. | |
groupId | string | The ID of the customer group to add the customer to. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateCustomerResponse CreateCustomer(ctx, body) CreateCustomer
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 | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
body | CreateCustomerRequest | An object containing the fields to POST for the request. |
See the corresponding object definition for field details. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateCustomerCardResponse CreateCustomerCard(ctx, body, customerId) CreateCustomerCard
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.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
body | CreateCustomerCardRequest | An object containing the fields to POST for the request. |
See the corresponding object definition for field details. | customerId | string| The Square ID of the customer profile the card is linked to. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteCustomerResponse DeleteCustomer(ctx, customerId) DeleteCustomer
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 | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerId | string | The ID of the customer to delete. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteCustomerCardResponse DeleteCustomerCard(ctx, customerId, cardId) DeleteCustomerCard
Removes a card on file from a customer.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerId | string | The ID of the customer that the card on file belongs to. | |
cardId | string | The ID of the card on file to delete. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListCustomersResponse ListCustomers(ctx, optional) ListCustomers
Lists customer profiles associated with a Square account. Under normal operating conditions, newly created or updated customer profiles become available for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated profiles can take closer to one minute or longer, especially during network incidents and outages.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | *CustomersApiListCustomersOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a CustomersApiListCustomersOpts struct
Name | Type | Description | Notes |
---|---|---|---|
cursor | optional.String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See the Pagination guide for more information. | |
sortField | optional.String | Indicates how Customers should be sorted. Default: `DEFAULT`. | |
sortOrder | optional.String | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveGroupFromCustomerResponse RemoveGroupFromCustomer(ctx, customerId, groupId) RemoveGroupFromCustomer
Removes a group membership from a customer. The customer is identified by the customer_id
value and the customer group is identified by the group_id
value.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerId | string | The ID of the customer to remove from the group. | |
groupId | string | The ID of the customer group to remove the customer from. |
RemoveGroupFromCustomerResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RetrieveCustomerResponse RetrieveCustomer(ctx, customerId) RetrieveCustomer
Returns details for a single customer.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerId | string | The ID of the customer to retrieve. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SearchCustomersResponse SearchCustomers(ctx, body) SearchCustomers
Searches the customer profiles associated with a Square account using a supported query filter. Calling SearchCustomers
without any explicit query filter returns all customer profiles ordered alphabetically based on given_name
and family_name
. Under normal operating conditions, newly created or updated customer profiles become available for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated profiles can take closer to one minute or longer, especially during network incidents and outages.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
body | SearchCustomersRequest | An object containing the fields to POST for the request. |
See the corresponding object definition for field details. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateCustomerResponse UpdateCustomer(ctx, body, customerId) UpdateCustomer
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 | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
body | UpdateCustomerRequest | An object containing the fields to POST for the request. |
See the corresponding object definition for field details. | customerId | string| The ID of the customer to update. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]