customers

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddGroupsRequest added in v1.2.0

type AddGroupsRequest struct {
	// The ID of the customer to add to a group.
	CustomerID string `json:"-" url:"-"`
	// The ID of the customer group to add the customer to.
	GroupID string `json:"-" url:"-"`
}

type BatchUpsertCustomerCustomAttributesRequest

type BatchUpsertCustomerCustomAttributesRequest struct {
	// A map containing 1 to 25 individual upsert requests. For each request, provide an
	// arbitrary ID that is unique for this `BulkUpsertCustomerCustomAttributes` request and the
	// information needed to create or update a custom attribute.
	Values map[string]*squaregosdk.BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest `json:"values,omitempty" url:"-"`
}

type CardsDeleteRequest

type CardsDeleteRequest = DeleteCardsRequest

CardsDeleteRequest is an alias for DeleteCardsRequest.

type CreateCustomerCardRequest

type CreateCustomerCardRequest struct {
	// The Square ID of the customer profile the card is linked to.
	CustomerID string `json:"-" url:"-"`
	// A card nonce representing the credit card to link to the customer.
	//
	// Card nonces are generated by the Square payment form when customers enter
	// their card information. For more information, see
	// [Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/web-payments/take-card-payment).
	//
	// __NOTE:__ Card nonces generated by digital wallets (such as Apple Pay)
	// cannot be used to create a customer card.
	CardNonce string `json:"card_nonce" url:"-"`
	// Address information for the card on file.
	//
	// __NOTE:__ If a billing address is provided in the request, the
	// `CreateCustomerCardRequest.billing_address.postal_code` must match
	// the postal code encoded in the card nonce.
	BillingAddress *squaregosdk.Address `json:"billing_address,omitempty" url:"-"`
	// The full name printed on the credit card.
	CardholderName *string `json:"cardholder_name,omitempty" url:"-"`
	// An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).
	// Verification tokens encapsulate customer device information and 3-D Secure
	// challenge results to indicate that Square has verified the buyer identity.
	VerificationToken *string `json:"verification_token,omitempty" url:"-"`
}

type CreateCustomerCustomAttributeDefinitionRequest

type CreateCustomerCustomAttributeDefinitionRequest struct {
	// The custom attribute definition to create. Note the following:
	// - With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema
	// definition hosted on the Square CDN. For more information, including supported values and constraints, see
	// [Specifying the schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema).
	// - If provided, `name` must be unique (case-sensitive) across all visible customer-related custom attribute definitions for the seller.
	// - All custom attributes are visible in exported customer data, including those set to `VISIBILITY_HIDDEN`.
	CustomAttributeDefinition *squaregosdk.CustomAttributeDefinition `json:"custom_attribute_definition,omitempty" url:"-"`
	// A unique identifier for this request, used to ensure idempotency. For more information,
	// see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
	IdempotencyKey *string `json:"idempotency_key,omitempty" url:"-"`
}

type CreateCustomerGroupRequest

type CreateCustomerGroupRequest struct {
	// The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
	IdempotencyKey *string `json:"idempotency_key,omitempty" url:"-"`
	// The customer group to create.
	Group *squaregosdk.CustomerGroup `json:"group,omitempty" url:"-"`
}

type CustomAttributeDefinitionsDeleteRequest

type CustomAttributeDefinitionsDeleteRequest = DeleteCustomAttributeDefinitionsRequest

CustomAttributeDefinitionsDeleteRequest is an alias for DeleteCustomAttributeDefinitionsRequest.

type CustomAttributeDefinitionsGetRequest

type CustomAttributeDefinitionsGetRequest = GetCustomAttributeDefinitionsRequest

CustomAttributeDefinitionsGetRequest is an alias for GetCustomAttributeDefinitionsRequest.

type CustomAttributeDefinitionsListRequest

type CustomAttributeDefinitionsListRequest = ListCustomAttributeDefinitionsRequest

CustomAttributeDefinitionsListRequest is an alias for ListCustomAttributeDefinitionsRequest.

type CustomAttributesDeleteRequest

type CustomAttributesDeleteRequest = DeleteCustomAttributesRequest

CustomAttributesDeleteRequest is an alias for DeleteCustomAttributesRequest.

type CustomAttributesGetRequest

type CustomAttributesGetRequest = GetCustomAttributesRequest

CustomAttributesGetRequest is an alias for GetCustomAttributesRequest.

type CustomAttributesListRequest

type CustomAttributesListRequest = ListCustomAttributesRequest

CustomAttributesListRequest is an alias for ListCustomAttributesRequest.

type DeleteCardsRequest added in v1.2.0

type DeleteCardsRequest struct {
	// The ID of the customer that the card on file belongs to.
	CustomerID string `json:"-" url:"-"`
	// The ID of the card on file to delete.
	CardID string `json:"-" url:"-"`
}

type DeleteCustomAttributeDefinitionsRequest added in v1.2.0

type DeleteCustomAttributeDefinitionsRequest struct {
	// The key of the custom attribute definition to delete.
	Key string `json:"-" url:"-"`
}

type DeleteCustomAttributesRequest added in v1.2.0

type DeleteCustomAttributesRequest struct {
	// The ID of the target [customer profile](entity:Customer).
	CustomerID string `json:"-" url:"-"`
	// The key of the custom attribute to delete. This key must match the `key` of a custom
	// attribute definition in the Square seller account. If the requesting application is not the
	// definition owner, you must use the qualified key.
	Key string `json:"-" url:"-"`
}

type DeleteGroupsRequest added in v1.2.0

type DeleteGroupsRequest struct {
	// The ID of the customer group to delete.
	GroupID string `json:"-" url:"-"`
}

type GetCustomAttributeDefinitionsRequest added in v1.2.0

type GetCustomAttributeDefinitionsRequest struct {
	// The key of the custom attribute definition to retrieve. If the requesting application
	// is not the definition owner, you must use the qualified key.
	Key string `json:"-" url:"-"`
	// The current version of the custom attribute definition, which is used for strongly consistent
	// reads to guarantee that you receive the most up-to-date data. When included in the request,
	// Square returns the specified version or a higher version if one exists. If the specified version
	// is higher than the current version, Square returns a `BAD_REQUEST` error.
	Version *int `json:"-" url:"version,omitempty"`
}

type GetCustomAttributesRequest added in v1.2.0

type GetCustomAttributesRequest struct {
	// The ID of the target [customer profile](entity:Customer).
	CustomerID string `json:"-" url:"-"`
	// The key of the custom attribute to retrieve. This key must match the `key` of a custom
	// attribute definition in the Square seller account. If the requesting application is not the
	// definition owner, you must use the qualified key.
	Key string `json:"-" url:"-"`
	// Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of
	// the custom attribute. Set this parameter to `true` to get the name and description of the custom
	// attribute, information about the data type, or other definition details. The default value is `false`.
	WithDefinition *bool `json:"-" url:"with_definition,omitempty"`
	// The current version of the custom attribute, which is used for strongly consistent reads to
	// guarantee that you receive the most up-to-date data. When included in the request, Square
	// returns the specified version or a higher version if one exists. If the specified version is
	// higher than the current version, Square returns a `BAD_REQUEST` error.
	Version *int `json:"-" url:"version,omitempty"`
}

type GetGroupsRequest added in v1.2.0

type GetGroupsRequest struct {
	// The ID of the customer group to retrieve.
	GroupID string `json:"-" url:"-"`
}

type GetSegmentsRequest added in v1.2.0

type GetSegmentsRequest struct {
	// The Square-issued ID of the customer segment.
	SegmentID string `json:"-" url:"-"`
}

type GroupsAddRequest

type GroupsAddRequest = AddGroupsRequest

GroupsAddRequest is an alias for AddGroupsRequest.

type GroupsDeleteRequest

type GroupsDeleteRequest = DeleteGroupsRequest

GroupsDeleteRequest is an alias for DeleteGroupsRequest.

type GroupsGetRequest

type GroupsGetRequest = GetGroupsRequest

GroupsGetRequest is an alias for GetGroupsRequest.

type GroupsListRequest

type GroupsListRequest = ListGroupsRequest

GroupsListRequest is an alias for ListGroupsRequest.

type GroupsRemoveRequest

type GroupsRemoveRequest = RemoveGroupsRequest

GroupsRemoveRequest is an alias for RemoveGroupsRequest.

type ListCustomAttributeDefinitionsRequest added in v1.2.0

type ListCustomAttributeDefinitionsRequest struct {
	// The maximum number of results to return in a single paged response. This limit is advisory.
	// The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
	// The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Limit *int `json:"-" url:"limit,omitempty"`
	// The cursor returned in the paged response from the previous call to this endpoint.
	// Provide this cursor to retrieve the next page of results for your original request.
	// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor *string `json:"-" url:"cursor,omitempty"`
}

type ListCustomAttributesRequest added in v1.2.0

type ListCustomAttributesRequest struct {
	// The ID of the target [customer profile](entity:Customer).
	CustomerID string `json:"-" url:"-"`
	// The maximum number of results to return in a single paged response. This limit is advisory.
	// The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.
	// The default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Limit *int `json:"-" url:"limit,omitempty"`
	// The cursor returned in the paged response from the previous call to this endpoint.
	// Provide this cursor to retrieve the next page of results for your original request. For more
	// information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor *string `json:"-" url:"cursor,omitempty"`
	// Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each
	// custom attribute. Set this parameter to `true` to get the name and description of each custom
	// attribute, information about the data type, or other definition details. The default value is `false`.
	WithDefinitions *bool `json:"-" url:"with_definitions,omitempty"`
}

type ListGroupsRequest added in v1.2.0

type ListGroupsRequest struct {
	// A pagination cursor returned by a previous call to this endpoint.
	// Provide this cursor to retrieve the next set of results for your original query.
	//
	// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor *string `json:"-" url:"cursor,omitempty"`
	// The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
	// If the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.
	//
	// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Limit *int `json:"-" url:"limit,omitempty"`
}

type ListSegmentsRequest added in v1.2.0

type ListSegmentsRequest struct {
	// A pagination cursor returned by previous calls to `ListCustomerSegments`.
	// This cursor is used to retrieve the next set of query results.
	//
	// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor *string `json:"-" url:"cursor,omitempty"`
	// The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
	// If the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.
	//
	// For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Limit *int `json:"-" url:"limit,omitempty"`
}

type RemoveGroupsRequest added in v1.2.0

type RemoveGroupsRequest struct {
	// The ID of the customer to remove from the group.
	CustomerID string `json:"-" url:"-"`
	// The ID of the customer group to remove the customer from.
	GroupID string `json:"-" url:"-"`
}

type SegmentsGetRequest

type SegmentsGetRequest = GetSegmentsRequest

SegmentsGetRequest is an alias for GetSegmentsRequest.

type SegmentsListRequest

type SegmentsListRequest = ListSegmentsRequest

SegmentsListRequest is an alias for ListSegmentsRequest.

type UpdateCustomerCustomAttributeDefinitionRequest

type UpdateCustomerCustomAttributeDefinitionRequest struct {
	// The key of the custom attribute definition to update.
	Key string `json:"-" url:"-"`
	// The custom attribute definition that contains the fields to update. This endpoint
	// supports sparse updates, so only new or changed fields need to be included in the request.
	// Only the following fields can be updated:
	//
	// - `name`
	// - `description`
	// - `visibility`
	// - `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed
	// selections are supported.
	//
	// For more information, see
	// [Updatable definition fields](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields).
	//
	// To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
	// control, include the optional `version` field and specify the current version of the custom attribute definition.
	CustomAttributeDefinition *squaregosdk.CustomAttributeDefinition `json:"custom_attribute_definition,omitempty" url:"-"`
	// A unique identifier for this request, used to ensure idempotency. For more information,
	// see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
	IdempotencyKey *string `json:"idempotency_key,omitempty" url:"-"`
}

type UpdateCustomerGroupRequest

type UpdateCustomerGroupRequest struct {
	// The ID of the customer group to update.
	GroupID string `json:"-" url:"-"`
	// The `CustomerGroup` object including all the updates you want to make.
	Group *squaregosdk.CustomerGroup `json:"group,omitempty" url:"-"`
}

type UpsertCustomerCustomAttributeRequest

type UpsertCustomerCustomAttributeRequest struct {
	// The ID of the target [customer profile](entity:Customer).
	CustomerID string `json:"-" url:"-"`
	// The key of the custom attribute to create or update. This key must match the `key` of a
	// custom attribute definition in the Square seller account. If the requesting application is not
	// the definition owner, you must use the qualified key.
	Key string `json:"-" url:"-"`
	// The custom attribute to create or update, with the following fields:
	//
	// - `value`. This value must conform to the `schema` specified by the definition.
	// For more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).
	//
	// - `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
	// control for an update operation, include this optional field and specify the current version
	// of the custom attribute.
	CustomAttribute *squaregosdk.CustomAttribute `json:"custom_attribute,omitempty" url:"-"`
	// A unique identifier for this request, used to ensure idempotency. For more information,
	// see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
	IdempotencyKey *string `json:"idempotency_key,omitempty" url:"-"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL