models

package
v0.0.0-...-8b0bed9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddGroupToCustomerRequest

type AddGroupToCustomerRequest struct {
}

Defines the fields that are included in the request body of a request to the [AddGroupToCustomer](https://developer.squareup.com/reference/square_2023-12-13/customers-api/add-group-to-customer) endpoint.

type AddGroupToCustomerResponse

type AddGroupToCustomerResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the [AddGroupToCustomer](https://developer.squareup.com/reference/square_2023-12-13/customers-api/add-group-to-customer) endpoint.

type AdditionalRecipient

type AdditionalRecipient struct {
	// The location ID for a recipient (other than the merchant) receiving a portion of this tender.
	LocationId string `json:"location_id"`
	// The description of the additional recipient.
	Description string `json:"description,omitempty"`
	// The amount of money distributed to the recipient.
	AmountMoney *Money `json:"amount_money"`
	// The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for any `AdditionalRecipient` objects created after the retirement.
	ReceivableId string `json:"receivable_id,omitempty"`
}

Represents an additional recipient (other than the merchant) receiving a portion of this tender.

type Address

type Address struct {
	// The first line of the address.  Fields that start with `address_line` provide the address's most specific details, like street number, street name, and building name. They do *not* provide less specific details like city, state/province, or country (these details are provided in other fields).
	AddressLine1 string `json:"address_line_1,omitempty"`
	// The second line of the address, if any.
	AddressLine2 string `json:"address_line_2,omitempty"`
	// The third line of the address, if any.
	AddressLine3 string `json:"address_line_3,omitempty"`
	// The city or town of the address. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
	Locality string `json:"locality,omitempty"`
	// A civil region within the address's `locality`, if any.
	Sublocality string `json:"sublocality,omitempty"`
	// A civil region within the address's `sublocality`, if any.
	Sublocality2 string `json:"sublocality_2,omitempty"`
	// A civil region within the address's `sublocality_2`, if any.
	Sublocality3 string `json:"sublocality_3,omitempty"`
	// A civil entity within the address's country. In the US, this is the state. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
	AdministrativeDistrictLevel1 string `json:"administrative_district_level_1,omitempty"`
	// A civil entity within the address's `administrative_district_level_1`. In the US, this is the county.
	AdministrativeDistrictLevel2 string `json:"administrative_district_level_2,omitempty"`
	// A civil entity within the address's `administrative_district_level_2`, if any.
	AdministrativeDistrictLevel3 string `json:"administrative_district_level_3,omitempty"`
	// The address's postal code. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
	PostalCode string `json:"postal_code,omitempty"`
	// The address's country, in the two-letter format of ISO 3166. For example, `US` or `FR`.
	Country string `json:"country,omitempty"`
	// Optional first name when it's representing recipient.
	FirstName string `json:"first_name,omitempty"`
	// Optional last name when it's representing recipient.
	LastName string `json:"last_name,omitempty"`
}

Represents a postal address in a country. For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).

type ApplicationDetails

type ApplicationDetails struct {
	// The Square product, such as Square Point of Sale (POS),  Square Invoices, or Square Virtual Terminal.
	SquareProduct string `json:"square_product,omitempty"`
	// The Square ID assigned to the application used to take the payment.  Application developers can use this information to identify payments that  their application processed.  For example, if a developer uses a custom application to process payments,  this field contains the application ID from the Developer Dashboard.  If a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace)  application to process payments, the field contains the corresponding application ID.
	ApplicationId string `json:"application_id,omitempty"`
}

Details about the application that took the payment.

type BatchRetrieveOrdersRequest

type BatchRetrieveOrdersRequest struct {
	// The ID of the location for these orders. This field is optional: omit it to retrieve orders within the scope of the current authorization's merchant ID.
	LocationId string `json:"location_id,omitempty"`
	// The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request.
	OrderIds []string `json:"order_ids"`
}

Defines the fields that are included in requests to the `BatchRetrieveOrders` endpoint.

type BatchRetrieveOrdersResponse

type BatchRetrieveOrdersResponse struct {
	// The requested orders. This will omit any requested orders that do not exist.
	Orders []Order `json:"orders,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the `BatchRetrieveOrders` endpoint.

type BulkDeleteOrderCustomAttributesRequest

type BulkDeleteOrderCustomAttributesRequest struct {
	// A map of requests that correspond to individual delete operations for custom attributes.
	Values map[string]BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute `json:"values"`
}

Represents a bulk delete request for one or more order custom attributes.

type BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute

type BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute struct {
	// The key of the custom attribute to delete.  This key must match the key  of an existing custom attribute definition.
	Key string `json:"key,omitempty"`
	// The ID of the target [order](https://developer.squareup.com/reference/square_2023-12-13/objects/Order).
	OrderId string `json:"order_id"`
}

Represents one delete within the bulk operation.

type BulkDeleteOrderCustomAttributesResponse

type BulkDeleteOrderCustomAttributesResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	//  A map of responses that correspond to individual delete requests. Each response has the same ID  as the corresponding request and contains either a `custom_attribute` or an `errors` field.
	Values map[string]DeleteOrderCustomAttributeResponse `json:"values"`
}

Represents a response from deleting one or more order custom attributes.

type BulkUpsertOrderCustomAttributesRequest

type BulkUpsertOrderCustomAttributesRequest struct {
	// A map of requests that correspond to individual upsert operations for custom attributes.
	Values map[string]BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute `json:"values"`
}

Represents a bulk upsert request for one or more order custom attributes.

type BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute

type BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute struct {
	// 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, include this optional field and specify the current version of the custom attribute.
	CustomAttribute *CustomAttribute `json:"custom_attribute"`
	// 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"`
	// The ID of the target [order](https://developer.squareup.com/reference/square_2023-12-13/objects/Order).
	OrderId string `json:"order_id"`
}

Represents one upsert within the bulk operation.

type BulkUpsertOrderCustomAttributesResponse

type BulkUpsertOrderCustomAttributesResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	//  A map of responses that correspond to individual upsert operations for custom attributes.
	Values map[string]UpsertOrderCustomAttributeResponse `json:"values"`
}

Represents a response from a bulk upsert of order custom attributes.

type CalculateOrderRequest

type CalculateOrderRequest struct {
	// The order to be calculated. Expects the entire order, not a sparse update.
	Order *Order `json:"order"`
	// Identifies one or more loyalty reward tiers to apply during the order calculation. The discounts defined by the reward tiers are added to the order only to preview the effect of applying the specified rewards. The rewards do not correspond to actual redemptions; that is, no `reward`s are created. Therefore, the reward `id`s are random strings used only to reference the reward tier.
	ProposedRewards []OrderReward `json:"proposed_rewards,omitempty"`
}

type CalculateOrderResponse

type CalculateOrderResponse struct {
	// The calculated version of the order provided in the request.
	Order *Order `json:"order,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

type CancelPaymentByIdempotencyKeyRequest

type CancelPaymentByIdempotencyKeyRequest struct {
	// The `idempotency_key` identifying the payment to be canceled.
	IdempotencyKey string `json:"idempotency_key"`
}

Describes a request to cancel a payment using [CancelPaymentByIdempotencyKey](https://developer.squareup.com/reference/square_2023-12-13/payments-api/cancel-payment-by-idempotency-key).

type CancelPaymentByIdempotencyKeyResponse

type CancelPaymentByIdempotencyKeyResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the response returned by [CancelPaymentByIdempotencyKey](https://developer.squareup.com/reference/square_2023-12-13/payments-api/cancel-payment-by-idempotency-key). On success, `errors` is empty.

type CancelPaymentRequest

type CancelPaymentRequest struct {
}

Describes the request to cancel (void) a payment using [CancelPayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/cancel-payment). You can only cancel a payment that is approved (not completed). For more information, see [Delayed capture of a payment](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment).

type CancelPaymentResponse

type CancelPaymentResponse struct {
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The successfully canceled `Payment` object.
	Payment *Payment `json:"payment,omitempty"`
}

Defines the response returned by [CancelPayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/cancel-payment).

type CaptureTransactionRequest

type CaptureTransactionRequest struct {
}

type CaptureTransactionResponse

type CaptureTransactionResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the [CaptureTransaction](https://developer.squareup.com/reference/square_2023-12-13/transactions-api/capture-transaction) endpoint.

type Card

type Card struct {
	// Unique ID for this card. Generated by Square.
	Id string `json:"id,omitempty"`
	// The card's brand.
	CardBrand string `json:"card_brand,omitempty"`
	// The last 4 digits of the card number.
	Last4 string `json:"last_4,omitempty"`
	// The expiration month of the associated card as an integer between 1 and 12.
	ExpMonth int64 `json:"exp_month,omitempty"`
	// The four-digit year of the card's expiration date.
	ExpYear int64 `json:"exp_year,omitempty"`
	// The name of the cardholder.
	CardholderName string `json:"cardholder_name,omitempty"`
	// The billing address for this card.
	BillingAddress *Address `json:"billing_address,omitempty"`
	// Intended as a Square-assigned identifier, based on the card number, to identify the card across multiple locations within a single application.
	Fingerprint string `json:"fingerprint,omitempty"`
	// **Required** The ID of a customer created using the Customers API to be associated with the card.
	CustomerId string `json:"customer_id,omitempty"`
	// The ID of the merchant associated with the card.
	MerchantId string `json:"merchant_id,omitempty"`
	// An optional user-defined reference ID that associates this card with another entity in an external system. For example, a customer ID from an external customer management system.
	ReferenceId string `json:"reference_id,omitempty"`
	// Indicates whether or not a card can be used for payments.
	Enabled bool `json:"enabled,omitempty"`
	// The type of the card. The Card object includes this field only in response to Payments API calls.
	CardType string `json:"card_type,omitempty"`
	// Indicates whether the Card is prepaid or not. The Card object includes this field only in response to Payments API calls.
	PrepaidType string `json:"prepaid_type,omitempty"`
	// The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API returns this field.
	Bin string `json:"bin,omitempty"`
	// Current version number of the card. Increments with each card update. Requests to update an existing Card object will be rejected unless the version in the request matches the current version for the Card.
	Version int64 `json:"version,omitempty"`
	// The card's co-brand if available. For example, an Afterpay virtual card would have a co-brand of AFTERPAY.
	CardCoBrand string `json:"card_co_brand,omitempty"`
}

Represents the payment details of a card to be used for payments. These details are determined by the payment token generated by Web Payments SDK.

type CardBrand

type CardBrand string

CardBrand : Indicates a card's brand, such as `VISA` or `MASTERCARD`.

const (
	OTHER_BRAND_CardBrand         CardBrand = "OTHER_BRAND"
	VISA_CardBrand                CardBrand = "VISA"
	MASTERCARD_CardBrand          CardBrand = "MASTERCARD"
	AMERICAN_EXPRESS_CardBrand    CardBrand = "AMERICAN_EXPRESS"
	DISCOVER_CardBrand            CardBrand = "DISCOVER"
	DISCOVER_DINERS_CardBrand     CardBrand = "DISCOVER_DINERS"
	JCB_CardBrand                 CardBrand = "JCB"
	CHINA_UNIONPAY_CardBrand      CardBrand = "CHINA_UNIONPAY"
	SQUARE_GIFT_CARD_CardBrand    CardBrand = "SQUARE_GIFT_CARD"
	SQUARE_CAPITAL_CARD_CardBrand CardBrand = "SQUARE_CAPITAL_CARD"
	INTERAC_CardBrand             CardBrand = "INTERAC"
	EFTPOS_CardBrand              CardBrand = "EFTPOS"
	FELICA_CardBrand              CardBrand = "FELICA"
	EBT_CardBrand                 CardBrand = "EBT"
)

List of CardBrand

type CardCoBrand

type CardCoBrand string

CardCoBrand : Indicates the brand for a co-branded card.

const (
	UNKNOWN_CardCoBrand  CardCoBrand = "UNKNOWN"
	AFTERPAY_CardCoBrand CardCoBrand = "AFTERPAY"
	CLEARPAY_CardCoBrand CardCoBrand = "CLEARPAY"
)

List of CardCoBrand

type CardPaymentDetails

type CardPaymentDetails struct {
	// The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or FAILED.
	Status string `json:"status,omitempty"`
	// The credit card's non-confidential details.
	Card *Card `json:"card,omitempty"`
	// The method used to enter the card's details for the payment. The method can be `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
	EntryMethod string `json:"entry_method,omitempty"`
	// The status code returned from the Card Verification Value (CVV) check. The code can be `CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`.
	CvvStatus string `json:"cvv_status,omitempty"`
	// The status code returned from the Address Verification System (AVS) check. The code can be `AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`.
	AvsStatus string `json:"avs_status,omitempty"`
	// The status code returned by the card issuer that describes the payment's authorization status.
	AuthResultCode string `json:"auth_result_code,omitempty"`
	// For EMV payments, the application ID identifies the EMV application used for the payment.
	ApplicationIdentifier string `json:"application_identifier,omitempty"`
	// For EMV payments, the human-readable name of the EMV application used for the payment.
	ApplicationName string `json:"application_name,omitempty"`
	// For EMV payments, the cryptogram generated for the payment.
	ApplicationCryptogram string `json:"application_cryptogram,omitempty"`
	// For EMV payments, the method used to verify the cardholder's identity. The method can be `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`.
	VerificationMethod string `json:"verification_method,omitempty"`
	// For EMV payments, the results of the cardholder verification. The result can be `SUCCESS`, `FAILURE`, or `UNKNOWN`.
	VerificationResults string `json:"verification_results,omitempty"`
	// The statement description sent to the card networks.  Note: The actual statement description varies and is likely to be truncated and appended with additional information on a per issuer basis.
	StatementDescription string `json:"statement_description,omitempty"`
	// __Deprecated__: Use `Payment.device_details` instead.  Details about the device that took the payment.
	DeviceDetails *DeviceDetails `json:"device_details,omitempty"`
	// The timeline for card payments.
	CardPaymentTimeline *CardPaymentTimeline `json:"card_payment_timeline,omitempty"`
	// Whether the card must be physically present for the payment to be refunded.  If set to `true`, the card must be present.
	RefundRequiresCardPresence bool `json:"refund_requires_card_presence,omitempty"`
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Reflects the current status of a card payment. Contains only non-confidential information.

type CardPaymentTimeline

type CardPaymentTimeline struct {
	// The timestamp when the payment was authorized, in RFC 3339 format.
	AuthorizedAt string `json:"authorized_at,omitempty"`
	// The timestamp when the payment was captured, in RFC 3339 format.
	CapturedAt string `json:"captured_at,omitempty"`
	// The timestamp when the payment was voided, in RFC 3339 format.
	VoidedAt string `json:"voided_at,omitempty"`
}

The timeline for card payments.

type CardPrepaidType

type CardPrepaidType string

CardPrepaidType : Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`.

const (
	UNKNOWN_PREPAID_TYPE_CardPrepaidType CardPrepaidType = "UNKNOWN_PREPAID_TYPE"
	NOT_PREPAID_CardPrepaidType          CardPrepaidType = "NOT_PREPAID"
	PREPAID_CardPrepaidType              CardPrepaidType = "PREPAID"
)

List of CardPrepaidType

type CardType

type CardType string

CardType : Indicates a card's type, such as `CREDIT` or `DEBIT`.

const (
	UNKNOWN_CARD_TYPE_CardType CardType = "UNKNOWN_CARD_TYPE"
	CREDIT_CardType            CardType = "CREDIT"
	DEBIT_CardType             CardType = "DEBIT"
)

List of CardType

type CashPaymentDetails

type CashPaymentDetails struct {
	// The amount and currency of the money supplied by the buyer.
	BuyerSuppliedMoney *Money `json:"buyer_supplied_money"`
	// The amount of change due back to the buyer.  This read-only field is calculated from the `amount_money` and `buyer_supplied_money` fields.
	ChangeBackMoney *Money `json:"change_back_money,omitempty"`
}

Stores details about a cash payment. Contains only non-confidential information. For more information, see [Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments).

type CloneOrderRequest

type CloneOrderRequest struct {
	// The ID of the order to clone.
	OrderId string `json:"order_id"`
	// An optional order version for concurrency protection.  If a version is provided, it must match the latest stored version of the order to clone. If a version is not provided, the API clones the latest version.
	Version int32 `json:"version,omitempty"`
	// A value you specify that uniquely identifies this clone request.  If you are unsure whether a particular order was cloned successfully, you can reattempt the call with the same idempotency key without worrying about creating duplicate cloned orders. The originally cloned order is returned.  For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
	IdempotencyKey string `json:"idempotency_key,omitempty"`
}

Defines the fields that are included in requests to the [CloneOrder](https://developer.squareup.com/reference/square_2023-12-13/orders-api/clone-order) endpoint.

type CloneOrderResponse

type CloneOrderResponse struct {
	// The cloned order.
	Order *Order `json:"order,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the [CloneOrder](https://developer.squareup.com/reference/square_2023-12-13/orders-api/clone-order) endpoint.

type CompletePaymentRequest

type CompletePaymentRequest struct {
	// Used for optimistic concurrency. This opaque token identifies the current `Payment`  version that the caller expects. If the server has a different version of the Payment,  the update fails and a response with a VERSION_MISMATCH error is returned.
	VersionToken string `json:"version_token,omitempty"`
}

Describes a request to complete (capture) a payment using [CompletePayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/complete-payment). By default, payments are set to `autocomplete` immediately after they are created. To complete payments manually, set `autocomplete` to `false`.

type CompletePaymentResponse

type CompletePaymentResponse struct {
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The successfully completed payment.
	Payment *Payment `json:"payment,omitempty"`
}

Defines the response returned by[CompletePayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/complete-payment).

type CreateCustomerCardRequest

type CreateCustomerCardRequest struct {
	// 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"`
	// 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 *Address `json:"billing_address,omitempty"`
	// The full name printed on the credit card.
	CardholderName string `json:"cardholder_name,omitempty"`
	// 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"`
}

Defines the fields that are included in the request body of a request to the `CreateCustomerCard` endpoint.

type CreateCustomerCardResponse

type CreateCustomerCardResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The created card on file.
	Card *Card `json:"card,omitempty"`
}

Defines the fields that are included in the response body of a request to the `CreateCustomerCard` endpoint. Either `errors` or `card` is present in a given response (never both).

type CreateCustomerRequest

type CreateCustomerRequest 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"`
	// The given name (that is, the first name) associated with the customer profile.  The maximum length for this value is 300 characters.
	GivenName string `json:"given_name,omitempty"`
	// The family name (that is, the last name) associated with the customer profile.  The maximum length for this value is 300 characters.
	FamilyName string `json:"family_name,omitempty"`
	// A business name associated with the customer profile.  The maximum length for this value is 500 characters.
	CompanyName string `json:"company_name,omitempty"`
	// A nickname for the customer profile.  The maximum length for this value is 100 characters.
	Nickname string `json:"nickname,omitempty"`
	// The email address associated with the customer profile.  The maximum length for this value is 254 characters.
	EmailAddress string `json:"email_address,omitempty"`
	// The physical address associated with the customer profile. For maximum length constraints, see  [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). The `first_name` and `last_name` fields are ignored if they are present in the request.
	Address *Address `json:"address,omitempty"`
	// The phone number associated with the customer profile. The phone number must be valid and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).
	PhoneNumber string `json:"phone_number,omitempty"`
	// An optional second ID used to associate the customer profile with an entity in another system.  The maximum length for this value is 100 characters.
	ReferenceId string `json:"reference_id,omitempty"`
	// A custom note associated with the customer profile.
	Note string `json:"note,omitempty"`
	// The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.
	Birthday string `json:"birthday,omitempty"`
	// The tax ID associated with the customer profile. This field is available only for customers of sellers in EU countries or the United Kingdom.  In other countries, this field is ignored when included in a `CreateCustomer` request. For more information,  see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).
	TaxIds *CustomerTaxIds `json:"tax_ids,omitempty"`
}

Defines the body parameters that can be included in a request to the `CreateCustomer` endpoint.

type CreateCustomerResponse

type CreateCustomerResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The created customer.
	Customer *Customer `json:"customer,omitempty"`
}

Defines the fields that are included in the response body of a request to the `CreateCustomer` endpoint. Either `errors` or `customer` is present in a given response (never both).

type CreateOrderCustomAttributeDefinitionRequest

type CreateOrderCustomAttributeDefinitionRequest 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 *CustomAttributeDefinition `json:"custom_attribute_definition"`
	// 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"`
}

Represents a create request for an order custom attribute definition.

type CreateOrderCustomAttributeDefinitionResponse

type CreateOrderCustomAttributeDefinitionResponse struct {
	// The new custom attribute definition.
	CustomAttributeDefinition *CustomAttributeDefinition `json:"custom_attribute_definition,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from creating an order custom attribute definition.

type CreateOrderRequest

type CreateOrderRequest struct {
	// The order to create. If this field is set, the only other top-level field that can be set is the `idempotency_key`.
	Order *Order `json:"order,omitempty"`
	// A value you specify that uniquely identifies this order among orders you have created.  If you are unsure whether a particular order was created successfully, you can try it again with the same idempotency key without worrying about creating duplicate orders.  For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
	IdempotencyKey string `json:"idempotency_key,omitempty"`
}

type CreateOrderResponse

type CreateOrderResponse struct {
	// The newly created order.
	Order *Order `json:"order,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the `CreateOrder` endpoint. Either `errors` or `order` is present in a given response, but never both.

type CreatePaymentRequest

type CreatePaymentRequest struct {
	// The ID for the source of funds for this payment. This could be a payment token generated by the Web Payments SDK for any of its [supported methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment-methods), including cards, bank transfers, Afterpay or Cash App Pay. If recording a payment that the seller received outside of Square, specify either \"CASH\" or \"EXTERNAL\". For more information, see  [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).
	SourceId string `json:"source_id"`
	// A unique string that identifies this `CreatePayment` request. Keys can be any valid string but must be unique for every `CreatePayment` request.  Note: The number of allowed characters might be less than the stated maximum, if multi-byte characters are used.  For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
	IdempotencyKey string `json:"idempotency_key"`
	// The amount of money to accept for this payment, not including `tip_money`.  The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).  The currency code must match the currency associated with the business that is accepting the payment.
	AmountMoney *Money `json:"amount_money,omitempty"`
	// The amount designated as a tip, in addition to `amount_money`.  The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).  The currency code must match the currency associated with the business that is accepting the payment.
	TipMoney *Money `json:"tip_money,omitempty"`
	// The amount of money that the developer is taking as a fee for facilitating the payment on behalf of the seller.  The amount cannot be more than 90% of the total amount of the payment.  The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).  The fee currency code must match the currency associated with the seller that is accepting the payment. The application must be from a developer account in the same country and using the same currency code as the seller.  For more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).  To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).
	AppFeeMoney *Money `json:"app_fee_money,omitempty"`
	// The duration of time after the payment's creation when Square automatically  either completes or cancels the payment depending on the `delay_action` field value.  For more information, see  [Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).   This parameter should be specified as a time duration, in RFC 3339 format.  Note: This feature is only supported for card payments. This parameter can only be set for a delayed capture payment (`autocomplete=false`).  Default:  - Card-present payments: \"PT36H\" (36 hours) from the creation time. - Card-not-present payments: \"P7D\" (7 days) from the creation time.
	DelayDuration string `json:"delay_duration,omitempty"`
	// The action to be applied to the payment when the `delay_duration` has elapsed. The action must be CANCEL or COMPLETE. For more information, see  [Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).   Default: CANCEL
	DelayAction string `json:"delay_action,omitempty"`
	// If set to `true`, this payment will be completed when possible. If set to `false`, this payment is held in an approved state until either explicitly completed (captured) or canceled (voided). For more information, see [Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment).  Default: true
	Autocomplete bool `json:"autocomplete,omitempty"`
	// Associates a previously created order with this payment.
	OrderId string `json:"order_id,omitempty"`
	// The [Customer](https://developer.squareup.com/reference/square_2023-12-13/objects/Customer) ID of the customer associated with the payment.  This is required if the `source_id` refers to a card on file created using the Cards API.
	CustomerId string `json:"customer_id,omitempty"`
	// The location ID to associate with the payment. If not specified, the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location) is used.
	LocationId string `json:"location_id,omitempty"`
	// An optional [TeamMember](https://developer.squareup.com/reference/square_2023-12-13/objects/TeamMember) ID to associate with  this payment.
	TeamMemberId string `json:"team_member_id,omitempty"`
	// A user-defined ID to associate with the payment.  You can use this field to associate the payment to an entity in an external system  (for example, you might specify an order ID that is generated by a third-party shopping cart).
	ReferenceId string `json:"reference_id,omitempty"`
	// 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.  For more information, see [SCA Overview](https://developer.squareup.com/docs/sca-overview).
	VerificationToken string `json:"verification_token,omitempty"`
	// If set to `true` and charging a Square Gift Card, a payment might be returned with `amount_money` equal to less than what was requested. For example, a request for $20 when charging a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card payment. This field cannot be `true` when `autocomplete = true`.  For more information, see [Partial amount with Square Gift Cards](https://developer.squareup.com/docs/payments-api/take-payments#partial-payment-gift-card).  Default: false
	AcceptPartialAuthorization bool `json:"accept_partial_authorization,omitempty"`
	// The buyer's email address.
	BuyerEmailAddress string `json:"buyer_email_address,omitempty"`
	// The buyer's billing address.
	BillingAddress *Address `json:"billing_address,omitempty"`
	// The buyer's shipping address.
	ShippingAddress *Address `json:"shipping_address,omitempty"`
	// An optional note to be entered by the developer when creating a payment.
	Note string `json:"note,omitempty"`
	// Optional additional payment information to include on the customer's card statement as part of the statement description. This can be, for example, an invoice number, ticket number, or short description that uniquely identifies the purchase.  Note that the `statement_description_identifier` might get truncated on the statement description to fit the required information including the Square identifier (SQ *) and name of the seller taking the payment.
	StatementDescriptionIdentifier string `json:"statement_description_identifier,omitempty"`
	// Additional details required when recording a cash payment (`source_id` is CASH).
	CashDetails *CashPaymentDetails `json:"cash_details,omitempty"`
	// Additional details required when recording an external payment (`source_id` is EXTERNAL).
	ExternalDetails *ExternalPaymentDetails `json:"external_details,omitempty"`
	// Details about the customer making the payment.
	CustomerDetails *CustomerDetails `json:"customer_details,omitempty"`
}

Describes a request to create a payment using [CreatePayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/create-payment).

type CreatePaymentResponse

type CreatePaymentResponse struct {
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The newly created payment.
	Payment *Payment `json:"payment,omitempty"`
}

Defines the response returned by [CreatePayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/create-payment). If there are errors processing the request, the `payment` field might not be present, or it might be present with a status of `FAILED`.

type CustomAttribute

type CustomAttribute struct {
	// The identifier of the custom attribute definition and its corresponding custom attributes. This value can be a simple key, which is the key that is provided when the custom attribute definition is created, or a qualified key, if the requesting application is not the definition owner. The qualified key consists of the application ID of the custom attribute definition owner followed by the simple key that was provided when the definition was created. It has the format application_id:simple key.  The value for a simple key can contain up to 60 alphanumeric characters, periods (.), underscores (_), and hyphens (-).
	Key string `json:"key,omitempty"`
	// The value assigned to the custom attribute. It is validated against the custom attribute definition's schema on write operations. For more information about custom attribute values, see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview).
	Value interface{} `json:"value,omitempty"`
	// Read only. The current version of the custom attribute. This field is incremented when the custom attribute is changed. When updating an existing custom attribute value, you can provide this field and specify the current version of the custom attribute to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency). This field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads, see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview).
	Version int32 `json:"version,omitempty"`
	// A copy of the `visibility` field value for the associated custom attribute definition.
	Visibility string `json:"visibility,omitempty"`
	// A copy of the associated custom attribute definition object. This field is only set when the optional field is specified on the request.
	Definition *CustomAttributeDefinition `json:"definition,omitempty"`
	// The timestamp that indicates when the custom attribute was created or was most recently updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
	// The timestamp that indicates when the custom attribute was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
}

A custom attribute value. Each custom attribute value has a corresponding `CustomAttributeDefinition` object.

type CustomAttributeDefinition

type CustomAttributeDefinition struct {
	// The identifier of the custom attribute definition and its corresponding custom attributes. This value can be a simple key, which is the key that is provided when the custom attribute definition is created, or a qualified key, if the requesting application is not the definition owner. The qualified key consists of the application ID of the custom attribute definition owner followed by the simple key that was provided when the definition was created. It has the format application_id:simple key.  The value for a simple key can contain up to 60 alphanumeric characters, periods (.), underscores (_), and hyphens (-).  This field can not be changed after the custom attribute definition is created. This field is required when creating a definition and must be unique per application, seller, and resource type.
	Key string `json:"key,omitempty"`
	// The JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information, see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). This field is required when creating a definition.
	Schema interface{} `json:"schema,omitempty"`
	// The name of the custom attribute definition for API and seller-facing UI purposes. The name must be unique within the seller and application pair. This field is required if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
	Name string `json:"name,omitempty"`
	// Seller-oriented description of the custom attribute definition, including any constraints that the seller should observe. May be displayed as a tooltip in Square UIs. This field is required if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
	Description string `json:"description,omitempty"`
	// Specifies how the custom attribute definition and its values should be shared with the seller and other applications. If no value is specified, the value defaults to `VISIBILITY_HIDDEN`.
	Visibility string `json:"visibility,omitempty"`
	// Read only. The current version of the custom attribute definition. The value is incremented each time the custom attribute definition is updated. When updating a custom attribute definition, you can provide this field and specify the current version of the custom attribute definition to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency).  On writes, this field must be set to the latest version. Stale writes are rejected.  This field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads, see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview).
	Version int32 `json:"version,omitempty"`
	// The timestamp that indicates when the custom attribute definition was created or most recently updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
	// The timestamp that indicates when the custom attribute definition was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
}

Represents a definition for custom attribute values. A custom attribute definition specifies the key, visibility, schema, and other properties for a custom attribute.

type CustomAttributeDefinitionVisibility

type CustomAttributeDefinitionVisibility string

CustomAttributeDefinitionVisibility : The level of permission that a seller or other applications requires to view this custom attribute definition. The `Visibility` field controls who can read and write the custom attribute values and custom attribute definition.

const (
	HIDDEN_CustomAttributeDefinitionVisibility            CustomAttributeDefinitionVisibility = "VISIBILITY_HIDDEN"
	READ_ONLY_CustomAttributeDefinitionVisibility         CustomAttributeDefinitionVisibility = "VISIBILITY_READ_ONLY"
	READ_WRITE_VALUES_CustomAttributeDefinitionVisibility CustomAttributeDefinitionVisibility = "VISIBILITY_READ_WRITE_VALUES"
)

List of CustomAttributeDefinitionVisibility

type CustomAttributeFilter

type CustomAttributeFilter struct {
	// A query expression to filter items or item variations by matching their custom attributes' `custom_attribute_definition_id` property value against the the specified id. Exactly one of `custom_attribute_definition_id` or `key` must be specified.
	CustomAttributeDefinitionId string `json:"custom_attribute_definition_id,omitempty"`
	// A query expression to filter items or item variations by matching their custom attributes' `key` property value against the specified key. Exactly one of `custom_attribute_definition_id` or `key` must be specified.
	Key string `json:"key,omitempty"`
	// A query expression to filter items or item variations by matching their custom attributes' `string_value`  property value against the specified text. Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.
	StringFilter string `json:"string_filter,omitempty"`
	// A query expression to filter items or item variations with their custom attributes containing a number value within the specified range. Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.
	NumberFilter *ModelRange `json:"number_filter,omitempty"`
	// A query expression to filter items or item variations by matching  their custom attributes' `selection_uid_values` values against the specified selection uids. Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.
	SelectionUidsFilter []string `json:"selection_uids_filter,omitempty"`
	// A query expression to filter items or item variations by matching their custom attributes' `boolean_value` property values against the specified Boolean expression. Exactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.
	BoolFilter bool `json:"bool_filter,omitempty"`
}

Supported custom attribute query expressions for calling the [SearchCatalogItems](https://developer.squareup.com/reference/square_2023-12-13/catalog-api/search-catalog-items) endpoint to search for items or item variations.

type Customer

type Customer struct {
	// A unique Square-assigned ID for the customer profile.  If you need this ID for an API request, use the ID returned when you created the customer profile or call the [SearchCustomers](https://developer.squareup.com/reference/square_2023-12-13/customers-api/search-customers)  or [ListCustomers](https://developer.squareup.com/reference/square_2023-12-13/customers-api/list-customers) endpoint.
	Id string `json:"id,omitempty"`
	// The timestamp when the customer profile was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The timestamp when the customer profile was last updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
	// Payment details of the credit, debit, and gift cards stored on file for the customer profile.   DEPRECATED at version 2021-06-16. Replaced by calling [ListCards](https://developer.squareup.com/reference/square_2023-12-13/cards-api/list-cards) (for credit and debit cards on file)  or [ListGiftCards](https://developer.squareup.com/reference/square_2023-12-13/gift-cards-api/list-gift-cards) (for gift cards on file) and including the `customer_id` query parameter.  For more information, see [Migration notes](https://developer.squareup.com/docs/customers-api/what-it-does#migrate-customer-cards).
	Cards []Card `json:"cards,omitempty"`
	// The given name (that is, the first name) associated with the customer profile.
	GivenName string `json:"given_name,omitempty"`
	// The family name (that is, the last name) associated with the customer profile.
	FamilyName string `json:"family_name,omitempty"`
	// A nickname for the customer profile.
	Nickname string `json:"nickname,omitempty"`
	// A business name associated with the customer profile.
	CompanyName string `json:"company_name,omitempty"`
	// The email address associated with the customer profile.
	EmailAddress string `json:"email_address,omitempty"`
	// The physical address associated with the customer profile.
	Address *Address `json:"address,omitempty"`
	// The phone number associated with the customer profile.
	PhoneNumber string `json:"phone_number,omitempty"`
	// The birthday associated with the customer profile, in `YYYY-MM-DD` format. For example, `1998-09-21` represents September 21, 1998, and `0000-09-21` represents September 21 (without a birth year).
	Birthday string `json:"birthday,omitempty"`
	// An optional second ID used to associate the customer profile with an entity in another system.
	ReferenceId string `json:"reference_id,omitempty"`
	// A custom note associated with the customer profile.
	Note string `json:"note,omitempty"`
	// Represents general customer preferences.
	Preferences *CustomerPreferences `json:"preferences,omitempty"`
	// The method used to create the customer profile.
	CreationSource string `json:"creation_source,omitempty"`
	// The IDs of [customer groups](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerGroup) the customer belongs to.
	GroupIds []string `json:"group_ids,omitempty"`
	// The IDs of [customer segments](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerSegment) the customer belongs to.
	SegmentIds []string `json:"segment_ids,omitempty"`
	// The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership and cards on file.
	Version int64 `json:"version,omitempty"`
	// The tax ID associated with the customer profile. This field is present only for customers of sellers in EU countries or the United Kingdom.  For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).
	TaxIds *TaxIds `json:"tax_ids,omitempty"`
}

Represents a Square customer profile in the Customer Directory of a Square seller.

type CustomerAddressFilter

type CustomerAddressFilter struct {
	// The postal code to search for. Only an `exact` match is supported.
	PostalCode *CustomerTextFilter `json:"postal_code,omitempty"`
	// The country code to search for.
	Country string `json:"country,omitempty"`
}

The customer address filter. This filter is used in a CustomerCustomAttributeFilterValue(https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerCustomAttributeFilterValue) filter when searching by an `Address`-type custom attribute.

type CustomerCreationSource

type CustomerCreationSource string

CustomerCreationSource : Indicates the method used to create the customer profile.

const (
	OTHER_CustomerCreationSource              CustomerCreationSource = "OTHER"
	APPOINTMENTS_CustomerCreationSource       CustomerCreationSource = "APPOINTMENTS"
	COUPON_CustomerCreationSource             CustomerCreationSource = "COUPON"
	DELETION_RECOVERY_CustomerCreationSource  CustomerCreationSource = "DELETION_RECOVERY"
	DIRECTORY_CustomerCreationSource          CustomerCreationSource = "DIRECTORY"
	EGIFTING_CustomerCreationSource           CustomerCreationSource = "EGIFTING"
	EMAIL_COLLECTION_CustomerCreationSource   CustomerCreationSource = "EMAIL_COLLECTION"
	FEEDBACK_CustomerCreationSource           CustomerCreationSource = "FEEDBACK"
	IMPORT__CustomerCreationSource            CustomerCreationSource = "IMPORT"
	INVOICES_CustomerCreationSource           CustomerCreationSource = "INVOICES"
	LOYALTY_CustomerCreationSource            CustomerCreationSource = "LOYALTY"
	MARKETING_CustomerCreationSource          CustomerCreationSource = "MARKETING"
	MERGE_CustomerCreationSource              CustomerCreationSource = "MERGE"
	ONLINE_STORE_CustomerCreationSource       CustomerCreationSource = "ONLINE_STORE"
	INSTANT_PROFILE_CustomerCreationSource    CustomerCreationSource = "INSTANT_PROFILE"
	TERMINAL_CustomerCreationSource           CustomerCreationSource = "TERMINAL"
	THIRD_PARTY_CustomerCreationSource        CustomerCreationSource = "THIRD_PARTY"
	THIRD_PARTY_IMPORT_CustomerCreationSource CustomerCreationSource = "THIRD_PARTY_IMPORT"
	UNMERGE_RECOVERY_CustomerCreationSource   CustomerCreationSource = "UNMERGE_RECOVERY"
)

List of CustomerCreationSource

type CustomerCreationSourceFilter

type CustomerCreationSourceFilter struct {
	// The list of creation sources used as filtering criteria.
	Values []string `json:"values,omitempty"`
	// Indicates whether a customer profile matching the filter criteria should be included in the result or excluded from the result.  Default: `INCLUDE`.
	Rule string `json:"rule,omitempty"`
}

The creation source filter. If one or more creation sources are set, customer profiles are included in, or excluded from, the result if they match at least one of the filter criteria.

type CustomerCustomAttributeFilter

type CustomerCustomAttributeFilter struct {
	// The `key` of the [custom attribute](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomAttribute) to filter by. The key is the identifier of the custom attribute (and the corresponding custom attribute definition) and can be retrieved using the [Customer Custom Attributes API](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api).
	Key string `json:"key"`
	// A filter that corresponds to the data type of the target custom attribute. For example, provide the `phone` filter to search based on the value of a `PhoneNumber`-type custom attribute. The data type is specified by the schema field of the custom attribute definition, which can be retrieved using the [Customer Custom Attributes API](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api).  You must provide this `filter` field, the `updated_at` field, or both.
	Filter *CustomerCustomAttributeFilterValue `json:"filter,omitempty"`
	// The date range for when the custom attribute was last updated. The date range can include `start_at`, `end_at`, or both. Range boundaries are inclusive. Dates are specified as RFC 3339 timestamps.  You must provide this `updated_at` field, the `filter` field, or both.
	UpdatedAt *TimeRange `json:"updated_at,omitempty"`
}

The custom attribute filter. Use this filter in a set of [custom attribute filters](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerCustomAttributeFilters) to search based on the value or last updated date of a customer-related [custom attribute](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomAttribute).

type CustomerCustomAttributeFilterValue

type CustomerCustomAttributeFilterValue struct {
	// A filter for a query based on the value of an `Email`-type custom attribute. This filter is case-insensitive and can include `exact` or `fuzzy`, but not both.  For an `exact` match, provide the complete email address.  For a `fuzzy` match, provide a query expression containing one or more query tokens to match against the email address. Square removes any punctuation (including periods (.), underscores (_), and the @ symbol) and tokenizes the email addresses on spaces. A match is found if a tokenized email address contains all the tokens in the search query, irrespective of the token order. For example, `Steven gmail` matches steven.jones@gmail.com and mygmail@stevensbakery.com.
	Email *CustomerTextFilter `json:"email,omitempty"`
	// A filter for a query based on the value of a `PhoneNumber`-type custom attribute. This filter is case-insensitive and can include `exact` or `fuzzy`, but not both.  For an `exact` match, provide the complete phone number. This is always an E.164-compliant phone number that starts with the + sign followed by the country code and subscriber number. For example, the format for a US phone number is +12061112222.  For a `fuzzy` match, provide a query expression containing one or more query tokens to match against the phone number. Square removes any punctuation and tokenizes the expression on spaces. A match is found if a tokenized phone number contains all the tokens in the search query, irrespective of the token order. For example, `415 123 45` is tokenized to `415`, `123`, and `45`, which matches +14151234567 and +12345674158, but does not match +1234156780. Similarly, the expression `415` matches +14151234567, +12345674158, and +1234156780.
	Phone *CustomerTextFilter `json:"phone,omitempty"`
	// A filter for a query based on the value of a `String`-type custom attribute. This filter is case-insensitive and  can include `exact` or `fuzzy`, but not both.  For an `exact` match, provide the complete string.  For a `fuzzy` match, provide a query expression containing one or more query tokens in any order that contain complete words to match against the string. Square tokenizes the expression using a grammar-based tokenizer. For example, the expressions `quick brown`, `brown quick`, and `quick fox` match \"The quick brown fox jumps over the lazy dog\". However, `quick foxes` and `qui` do not match.
	Text *CustomerTextFilter `json:"text,omitempty"`
	// A filter for a query based on the display name for a `Selection`-type custom attribute value. This filter is case-sensitive and can contain `any`, `all`, or both. The `none` condition is not supported.  Provide the display name of each item that you want to search for. To find the display names for the selection, use the  [Customer Custom Attributes API](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api) to retrieve the corresponding custom attribute definition and then check the `schema.items.names` field. For more information, see [Search based on selection](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#custom-attribute-value-filter-selection).  Note that when a `Selection`-type custom attribute is assigned to a customer profile, the custom attribute value is a list of one or more UUIDs (sourced from the `schema.items.enum` field) that map to the item names. These UUIDs are unique per seller.
	Selection *FilterValue `json:"selection,omitempty"`
	// A filter for a query based on the value of a `Date`-type custom attribute.  Provide a date range for this filter using `start_at`, `end_at`, or both. Range boundaries are inclusive. Dates can be specified in `YYYY-MM-DD` format or as RFC 3339 timestamps.
	Date *TimeRange `json:"date,omitempty"`
	// A filter for a query based on the value of a `Number`-type custom attribute, which can be an integer or a decimal with up to 5 digits of precision.  Provide a numerical range for this filter using `start_at`, `end_at`, or both. Range boundaries are inclusive. Numbers are specified as decimals or integers. The absolute value of range boundaries must not exceed `(2^63-1)/10^5`, or 92233720368547.
	Number *FloatNumberRange `json:"number,omitempty"`
	// A filter for a query based on the value of a `Boolean`-type custom attribute.
	Boolean bool `json:"boolean,omitempty"`
	// A filter for a query based on the value of an `Address`-type custom attribute. The filter can include `postal_code`, `country`, or both.
	Address *CustomerAddressFilter `json:"address,omitempty"`
}

A type-specific filter used in a [custom attribute filter](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerCustomAttributeFilter) to search based on the value of a customer-related [custom attribute](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomAttribute).

type CustomerCustomAttributeFilters

type CustomerCustomAttributeFilters struct {
	// The custom attribute filters. Each filter must specify `key` and include the `filter` field with a type-specific filter, the `updated_at` field, or both. The provided keys must be unique within the list of custom attribute filters.
	Filters []CustomerCustomAttributeFilter `json:"filters,omitempty"`
}

The custom attribute filters in a set of [customer filters](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerFilter) used in a search query. Use this filter to search based on [custom attributes](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomAttribute) that are assigned to customer profiles. For more information, see [Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute).

type CustomerDetails

type CustomerDetails struct {
	// Indicates whether the customer initiated the payment.
	CustomerInitiated bool `json:"customer_initiated,omitempty"`
	// Indicates that the seller keyed in payment details on behalf of the customer. This is used to flag a payment as Mail Order / Telephone Order (MOTO).
	SellerKeyedIn bool `json:"seller_keyed_in,omitempty"`
}

Details about the customer making the payment.

type CustomerFilter

type CustomerFilter struct {
	// A filter to select customers based on their creation source.
	CreationSource *CustomerCreationSourceFilter `json:"creation_source,omitempty"`
	// A filter to select customers based on when they were created.
	CreatedAt *TimeRange `json:"created_at,omitempty"`
	// A filter to select customers based on when they were last updated.
	UpdatedAt *TimeRange `json:"updated_at,omitempty"`
	// A filter to [select customers by their email address](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-email-address)  visible to the seller.  This filter is case-insensitive.  For [exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-email-address), this filter causes the search to return customer profiles  whose `email_address` field value are identical to the email address provided in the query.  For [fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-email-address),  this filter causes the search to return customer profiles  whose `email_address` field value has a token-wise partial match against the filtering  expression in the query. For example, with `Steven gmail` provided in a search query, the search returns customers whose email address is `steven.johnson@gmail.com`  or `mygmail@stevensbakery.com`. Square removes any punctuation (including periods (.), underscores (_), and the @ symbol) and tokenizes the email addresses on spaces. A match is found if a tokenized email address contains all the tokens in the search query,  irrespective of the token order.
	EmailAddress *CustomerTextFilter `json:"email_address,omitempty"`
	// A filter to [select customers by their phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-phone-number) visible to the seller.  For [exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-phone-number), this filter returns customers whose phone number matches the specified query expression. The number in the query must be of an E.164-compliant form. In particular, it must include the leading `+` sign followed by a country code and then a subscriber number. For example, the standard E.164 form of a US phone number is `+12062223333` and an E.164-compliant variation is `+1 (206) 222-3333`. To match the query expression, stored customer phone numbers are converted to the standard E.164 form.  For [fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-phone-number), this filter returns customers whose phone number matches the token or tokens provided in the query expression. For example, with `415` provided in a search query, the search returns customers with the phone numbers `+1-415-212-1200`, `+1-212-415-1234`, and `+1 (551) 234-1567`. Similarly, a search query of `415 123` returns customers with the phone numbers `+1-212-415-1234` and `+1 (551) 234-1567` but not `+1-212-415-1200`. A match is found if a tokenized phone number contains all the tokens in the search query, irrespective of the token order.
	PhoneNumber *CustomerTextFilter `json:"phone_number,omitempty"`
	// A filter to [select customers by their reference IDs](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-reference-id). This filter is case-insensitive.  [Exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-reference-id)  of a customer's reference ID against a query's reference ID is evaluated as an exact match between two strings, character by character in the given order.  [Fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-reference-id)  of stored reference IDs against queried reference IDs works  exactly the same as fuzzy matching on email addresses. Non-alphanumeric characters  are replaced by spaces to tokenize stored and queried reference IDs. A match is found if a tokenized stored reference ID contains all tokens specified in any order in the query. For example, a query of `NYC M` matches customer profiles with the `reference_id` value of `NYC_M_35_JOHNSON` and `NYC_27_MURRAY`.
	ReferenceId *CustomerTextFilter `json:"reference_id,omitempty"`
	// A filter to select customers based on the [groups](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerGroup) they belong to. Group membership is controlled by sellers and developers.  The `group_ids` filter has the following syntax: “` \"group_ids\": { \"any\":  [\"{group_a_id}\", \"{group_b_id}\", ...], \"all\":  [\"{group_1_id}\", \"{group_2_id}\", ...], \"none\": [\"{group_i_id}\", \"{group_ii_id}\", ...] } “`  You can use any combination of the `any`, `all`, and `none` fields in the filter. With `any`, the search returns customers in groups `a` or `b` or any other group specified in the list. With `all`, the search returns customers in groups `1` and `2` and all other groups specified in the list. With `none`, the search returns customers not in groups `i` or `ii` or any other group specified in the list.  If any of the search conditions are not met, including when an invalid or non-existent group ID is provided, the result is an empty object (`{}`).
	GroupIds *FilterValue `json:"group_ids,omitempty"`
	// A filter to select customers based on one or more custom attributes.   This filter can contain up to 10 custom attribute filters. Each custom attribute filter specifies filtering criteria for a target custom attribute. If multiple custom attribute filters are provided, they are combined as an `AND` operation.  To be valid for a search, the custom attributes must be visible to the requesting application. For more information, including example queries, see [Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute).  Square returns matching customer profiles, which do not contain custom attributes. To retrieve customer-related custom attributes, use the [Customer Custom Attributes API](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api). For example, you can call [RetrieveCustomerCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api/retrieve-customer-custom-attribute) using a customer ID from the result set.
	CustomAttribute *CustomerCustomAttributeFilters `json:"custom_attribute,omitempty"`
	//  A filter to select customers based on the [segments](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerSegment) they belong to. Segment membership is dynamic and adjusts automatically based on whether customers meet the segment criteria.  You can provide up to three segment IDs in the filter, using any combination of the `all`, `any`, and `none` fields. For the following example, the results include customers who belong to both segment A and segment B but do not belong to segment C.  “` \"segment_ids\": { \"all\":  [\"{segment_A_id}\", \"{segment_B_id}\"], \"none\":  [\"{segment_C_id}\"] } “`  If an invalid or non-existent segment ID is provided in the filter, Square stops processing the request and returns a `400 BAD_REQUEST` error that includes the segment ID.
	SegmentIds *FilterValue `json:"segment_ids,omitempty"`
}

Represents the filtering criteria in a [search query](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerQuery) that defines how to filter customer profiles returned in [SearchCustomers](https://developer.squareup.com/reference/square_2023-12-13/customers-api/search-customers) results.

type CustomerGroup

type CustomerGroup struct {
	// A unique Square-generated ID for the customer group.
	Id string `json:"id,omitempty"`
	// The name of the customer group.
	Name string `json:"name"`
	// The timestamp when the customer group was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The timestamp when the customer group was last updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
}

Represents a group of customer profiles. Customer groups can be created, be modified, and have their membership defined using the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale.

type CustomerInclusionExclusion

type CustomerInclusionExclusion string

CustomerInclusionExclusion : Indicates whether customers should be included in, or excluded from, the result set when they match the filtering criteria.

const (
	INCLUDE_CustomerInclusionExclusion CustomerInclusionExclusion = "INCLUDE"
	EXCLUDE_CustomerInclusionExclusion CustomerInclusionExclusion = "EXCLUDE"
)

List of CustomerInclusionExclusion

type CustomerPreferences

type CustomerPreferences struct {
	// Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` means that the customer chose to opt out of email marketing from the current Square seller or from all Square sellers. This value is read-only from the Customers API.
	EmailUnsubscribed bool `json:"email_unsubscribed,omitempty"`
}

Represents communication preferences for the customer profile.

type CustomerQuery

type CustomerQuery struct {
	// The filtering criteria for the search query. A query can contain multiple filters in any combination. Multiple filters are combined as `AND` statements.  __Note:__ Combining multiple filters as `OR` statements is not supported. Instead, send multiple single-filter searches and join the result sets.
	Filter *CustomerFilter `json:"filter,omitempty"`
	// Sorting criteria for query results. The default behavior is to sort  customers alphabetically by `given_name` and `family_name`.
	Sort *CustomerSort `json:"sort,omitempty"`
}

Represents filtering and sorting criteria for a [SearchCustomers](https://developer.squareup.com/reference/square_2023-12-13/customers-api/search-customers) request.

type CustomerSegment

type CustomerSegment struct {
	// A unique Square-generated ID for the segment.
	Id string `json:"id,omitempty"`
	// The name of the segment.
	Name string `json:"name"`
	// The timestamp when the segment was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The timestamp when the segment was last updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
}

Represents a group of customer profiles that match one or more predefined filter criteria. Segments (also known as Smart Groups) are defined and created within the Customer Directory in the Square Seller Dashboard or Point of Sale.

type CustomerSort

type CustomerSort struct {
	// Indicates the fields to use as the sort key, which is either the default set of fields or `created_at`.  The default value is `DEFAULT`.
	Field string `json:"field,omitempty"`
	// Indicates the order in which results should be sorted based on the sort field value. Strings use standard alphabetic comparison to determine order. Strings representing numbers are sorted as strings.  The default value is `ASC`.
	Order string `json:"order,omitempty"`
}

Represents the sorting criteria in a [search query](https://developer.squareup.com/reference/square_2023-12-13/objects/CustomerQuery) that defines how to sort customer profiles returned in [SearchCustomers](https://developer.squareup.com/reference/square_2023-12-13/customers-api/search-customers) results.

type CustomerSortField

type CustomerSortField string

CustomerSortField : Specifies customer attributes as the sort key to customer profiles returned from a search.

const (
	DEFAULT__CustomerSortField   CustomerSortField = "DEFAULT"
	CREATED_AT_CustomerSortField CustomerSortField = "CREATED_AT"
)

List of CustomerSortField

type CustomerTaxIds

type CustomerTaxIds struct {
	// The EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain alphanumeric characters only.
	EuVat string `json:"eu_vat,omitempty"`
}

Represents the tax ID associated with a [customer profile](https://developer.squareup.com/reference/square_2023-12-13/objects/Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).

type CustomerTextFilter

type CustomerTextFilter struct {
	// Use the exact filter to select customers whose attributes match exactly the specified query.
	Exact string `json:"exact,omitempty"`
	// Use the fuzzy filter to select customers whose attributes match the specified query  in a fuzzy manner. When the fuzzy option is used, search queries are tokenized, and then  each query token must be matched somewhere in the searched attribute. For single token queries,  this is effectively the same behavior as a partial match operation.
	Fuzzy string `json:"fuzzy,omitempty"`
}

A filter to select customers based on exact or fuzzy matching of customer attributes against a specified query. Depending on the customer attributes, the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both.

type DeleteCustomerCardRequest

type DeleteCustomerCardRequest struct {
}

Defines the fields that are included in requests to the `DeleteCustomerCard` endpoint.

type DeleteCustomerCardResponse

type DeleteCustomerCardResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the `DeleteCustomerCard` endpoint.

type DeleteCustomerCustomAttributeDefinitionRequest

type DeleteCustomerCustomAttributeDefinitionRequest struct {
}

Represents a [DeleteCustomerCustomAttributeDefinition](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api/delete-customer-custom-attribute-definition) request.

type DeleteCustomerCustomAttributeDefinitionResponse

type DeleteCustomerCustomAttributeDefinitionResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from a delete request containing error messages if there are any.

type DeleteCustomerCustomAttributeRequest

type DeleteCustomerCustomAttributeRequest struct {
}

Represents a [DeleteCustomerCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api/delete-customer-custom-attribute) request.

type DeleteCustomerCustomAttributeResponse

type DeleteCustomerCustomAttributeResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a [DeleteCustomerCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api/delete-customer-custom-attribute) response. Either an empty object `{}` (for a successful deletion) or `errors` is present in the response.

type DeleteCustomerRequest

type DeleteCustomerRequest struct {
	// The current version of the customer profile.  As a best practice, you should include this parameter to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control.  For more information, see [Delete a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile).
	Version int64 `json:"version,omitempty"`
}

Defines the fields that are included in a request to the `DeleteCustomer` endpoint.

type DeleteCustomerResponse

type DeleteCustomerResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the `DeleteCustomer` endpoint.

type DeleteOrderCustomAttributeDefinitionRequest

type DeleteOrderCustomAttributeDefinitionRequest struct {
}

Represents a delete request for an order custom attribute definition.

type DeleteOrderCustomAttributeDefinitionResponse

type DeleteOrderCustomAttributeDefinitionResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from deleting an order custom attribute definition.

type DeleteOrderCustomAttributeRequest

type DeleteOrderCustomAttributeRequest struct {
}

Represents a delete request for an order custom attribute.

type DeleteOrderCustomAttributeResponse

type DeleteOrderCustomAttributeResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from deleting an order custom attribute.

type DestinationDetails

type DestinationDetails struct {
	// Details about a card refund. Only populated if the destination_type is `CARD`.
	CardDetails *DestinationDetailsCardRefundDetails `json:"card_details,omitempty"`
}

Details about a refund's destination.

type DestinationDetailsCardRefundDetails

type DestinationDetailsCardRefundDetails struct {
	// The card's non-confidential details.
	Card *Card `json:"card,omitempty"`
	// The method used to enter the card's details for the refund. The method can be `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
	EntryMethod string `json:"entry_method,omitempty"`
}

type DeviceDetails

type DeviceDetails struct {
	// The Square-issued ID of the device.
	DeviceId string `json:"device_id,omitempty"`
	// The Square-issued installation ID for the device.
	DeviceInstallationId string `json:"device_installation_id,omitempty"`
	// The name of the device set by the seller.
	DeviceName string `json:"device_name,omitempty"`
}

Details about the device that took the payment.

type ExternalPaymentDetails

type ExternalPaymentDetails struct {
	// The type of external payment the seller received. It can be one of the following: - CHECK - Paid using a physical check. - BANK_TRANSFER - Paid using external bank transfer. - OTHER\\_GIFT\\_CARD - Paid using a non-Square gift card. - CRYPTO - Paid using a crypto currency. - SQUARE_CASH - Paid using Square Cash App. - SOCIAL - Paid using peer-to-peer payment applications. - EXTERNAL - A third-party application gathered this payment outside of Square. - EMONEY - Paid using an E-money provider. - CARD - A credit or debit card that Square does not support. - STORED_BALANCE - Use for house accounts, store credit, and so forth. - FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals - OTHER - A type not listed here.
	Type_ string `json:"type"`
	// A description of the external payment source. For example,  \"Food Delivery Service\".
	Source string `json:"source"`
	// An ID to associate the payment to its originating source.
	SourceId string `json:"source_id,omitempty"`
	// The fees paid to the source. The `amount_money` minus this field is  the net amount seller receives.
	SourceFeeMoney *Money `json:"source_fee_money,omitempty"`
}

Stores details about an external payment. Contains only non-confidential information. For more information, see [Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments).

type FilterValue

type FilterValue struct {
	// A list of terms that must be present on the field of the resource.
	All []string `json:"all,omitempty"`
	// A list of terms where at least one of them must be present on the field of the resource.
	Any []string `json:"any,omitempty"`
	// A list of terms that must not be present on the field the resource
	None []string `json:"none,omitempty"`
}

A filter to select resources based on an exact field value. For any given value, the value can only be in one property. Depending on the field, either all properties can be set or only a subset will be available. Refer to the documentation of the field.

type FloatNumberRange

type FloatNumberRange struct {
	// A decimal value indicating where the range starts.
	StartAt string `json:"start_at,omitempty"`
	// A decimal value indicating where the range ends.
	EndAt string `json:"end_at,omitempty"`
}

Specifies a decimal number range.

type Fulfillment

type Fulfillment struct {
	// A unique ID that identifies the fulfillment only within this order.
	Uid string `json:"uid,omitempty"`
	// The type of the fulfillment.
	Type_ string `json:"type,omitempty"`
	// The state of the fulfillment.
	State string `json:"state,omitempty"`
	// Describes what order line items this fulfillment applies to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.
	LineItemApplication string `json:"line_item_application,omitempty"`
	// A list of entries pertaining to the fulfillment of an order. Each entry must reference a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to fulfill.  Multiple entries can reference the same line item `uid`, as long as the total quantity among all fulfillment entries referencing a single line item does not exceed the quantity of the order's line item itself.  An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`, `CANCELED`, or `FAILED`. Fulfillments can be created and completed independently before order completion.
	Entries []FulfillmentFulfillmentEntry `json:"entries,omitempty"`
	// Application-defined data attached to this fulfillment. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details).  Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character.  Values have a maximum length of 255 characters.  An application can have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
	// Contains details for a pickup fulfillment. These details are required when the fulfillment type is `PICKUP`.
	PickupDetails *FulfillmentPickupDetails `json:"pickup_details,omitempty"`
	// Contains details for a shipment fulfillment. These details are required when the fulfillment type is `SHIPMENT`.  A shipment fulfillment's relationship to fulfillment `state`: `PROPOSED`: A shipment is requested. `RESERVED`: Fulfillment accepted. Shipment processing. `PREPARED`: Shipment packaged. Shipping label created. `COMPLETED`: Package has been shipped. `CANCELED`: Shipment has been canceled. `FAILED`: Shipment has failed.
	ShipmentDetails *FulfillmentShipmentDetails `json:"shipment_details,omitempty"`
	//
	DeliveryDetails *FulfillmentDeliveryDetails `json:"delivery_details,omitempty"`
}

Contains details about how to fulfill this order. Orders can only be created with at most one fulfillment using the API. However, orders returned by the Orders API might contain multiple fulfillments because sellers can create multiple fulfillments using Square products such as Square Online.

type FulfillmentDeliveryDetails

type FulfillmentDeliveryDetails struct {
	// The contact information for the person to receive the fulfillment.
	Recipient *FulfillmentRecipient `json:"recipient,omitempty"`
	// Indicates the fulfillment delivery schedule type. If `SCHEDULED`, then `deliver_at` is required. If `ASAP`, then `prep_time_duration` is required. The default is `SCHEDULED`.
	ScheduleType string `json:"schedule_type,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").  Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
	PlacedAt string `json:"placed_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) that represents the start of the delivery period. When the fulfillment `schedule_type` is `ASAP`, the field is automatically set to the current time plus the `prep_time_duration`. Otherwise, the application can set this field while the fulfillment `state` is `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`).  The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	DeliverAt string `json:"deliver_at,omitempty"`
	// The duration of time it takes to prepare and deliver this fulfillment. The timestamp must be in RFC 3339 format (for example, \"P1W3D\").
	PrepTimeDuration string `json:"prep_time_duration,omitempty"`
	// The time period after the `deliver_at` timestamp in which to deliver the order. Applications can set this field when the fulfillment `state` is `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`).  The timestamp must be in RFC 3339 format (for example, \"P1W3D\").
	DeliveryWindowDuration string `json:"delivery_window_duration,omitempty"`
	// Provides additional instructions about the delivery fulfillment. It is displayed in the Square Point of Sale application and set by the API.
	Note string `json:"note,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicates when the seller completed the fulfillment. This field is automatically set when  fulfillment `state` changes to `COMPLETED`. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CompletedAt string `json:"completed_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicates when the seller started processing the fulfillment. This field is automatically set when the fulfillment `state` changes to `RESERVED`. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	InProgressAt string `json:"in_progress_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was rejected. This field is automatically set when the fulfillment `state` changes to `FAILED`. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	RejectedAt string `json:"rejected_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the seller marked the fulfillment as ready for courier pickup. This field is automatically set when the fulfillment `state` changes to PREPARED. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ReadyAt string `json:"ready_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was delivered to the recipient. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	DeliveredAt string `json:"delivered_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was canceled. This field is automatically set when the fulfillment `state` changes to `CANCELED`.  The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CanceledAt string `json:"canceled_at,omitempty"`
	// The delivery cancellation reason. Max length: 100 characters.
	CancelReason string `json:"cancel_reason,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when an order can be picked up by the courier for delivery. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CourierPickupAt string `json:"courier_pickup_at,omitempty"`
	// The period of time in which the order should be picked up by the courier after the `courier_pickup_at` timestamp. The time must be in RFC 3339 format (for example, \"P1W3D\").
	CourierPickupWindowDuration string `json:"courier_pickup_window_duration,omitempty"`
	// Whether the delivery is preferred to be no contact.
	IsNoContactDelivery bool `json:"is_no_contact_delivery,omitempty"`
	// A note to provide additional instructions about how to deliver the order.
	DropoffNotes string `json:"dropoff_notes,omitempty"`
	// The name of the courier provider.
	CourierProviderName string `json:"courier_provider_name,omitempty"`
	// The support phone number of the courier.
	CourierSupportPhoneNumber string `json:"courier_support_phone_number,omitempty"`
	// The identifier for the delivery created by Square.
	SquareDeliveryId string `json:"square_delivery_id,omitempty"`
	// The identifier for the delivery created by the third-party courier service.
	ExternalDeliveryId string `json:"external_delivery_id,omitempty"`
	// The flag to indicate the delivery is managed by a third party (ie DoorDash), which means we may not receive all recipient information for PII purposes.
	ManagedDelivery bool `json:"managed_delivery,omitempty"`
}

Describes delivery details of an order fulfillment.

type FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType

type FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType string

FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType : The schedule type of the delivery fulfillment.

const (
	SCHEDULED_FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED"
	ASAP_FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType      FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "ASAP"
)

List of FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType

type FulfillmentFulfillmentEntry

type FulfillmentFulfillmentEntry struct {
	// A unique ID that identifies the fulfillment entry only within this order.
	Uid string `json:"uid,omitempty"`
	// The `uid` from the order line item.
	LineItemUid string `json:"line_item_uid"`
	// The quantity of the line item being fulfilled, formatted as a decimal number. For example, `\"3\"`.  Fulfillments for line items with a `quantity_unit` can have non-integer quantities. For example, `\"1.70000\"`.
	Quantity string `json:"quantity"`
	// Application-defined data attached to this fulfillment entry. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details).  Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character.  Values have a maximum length of 255 characters.  An application can have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
}

Links an order line item to a fulfillment. Each entry must reference a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to fulfill.

type FulfillmentFulfillmentLineItemApplication

type FulfillmentFulfillmentLineItemApplication string

FulfillmentFulfillmentLineItemApplication : The `line_item_application` describes what order line items this fulfillment applies to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.

const (
	ALL_FulfillmentFulfillmentLineItemApplication        FulfillmentFulfillmentLineItemApplication = "ALL"
	ENTRY_LIST_FulfillmentFulfillmentLineItemApplication FulfillmentFulfillmentLineItemApplication = "ENTRY_LIST"
)

List of FulfillmentFulfillmentLineItemApplication

type FulfillmentPickupDetails

type FulfillmentPickupDetails struct {
	// Information about the person to pick up this fulfillment from a physical location.
	Recipient *FulfillmentRecipient `json:"recipient,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment expires if it is not accepted. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\"). The expiration time can only be set up to 7 days in the future. If `expires_at` is not set, this pickup fulfillment is automatically accepted when placed.
	ExpiresAt string `json:"expires_at,omitempty"`
	// The duration of time after which an open and accepted pickup fulfillment is automatically moved to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, \"P1W3D\").  If not set, this pickup fulfillment remains accepted until it is canceled or completed.
	AutoCompleteDuration string `json:"auto_complete_duration,omitempty"`
	// The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`.
	ScheduleType string `json:"schedule_type,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".  For fulfillments with the schedule type `ASAP`, this is automatically set to the current time plus the expected duration to prepare the fulfillment.
	PickupAt string `json:"pickup_at,omitempty"`
	// The window of time in which the order should be picked up after the `pickup_at` timestamp. Must be in RFC 3339 duration format, e.g., \"P1W3D\". Can be used as an informational guideline for merchants.
	PickupWindowDuration string `json:"pickup_window_duration,omitempty"`
	// The duration of time it takes to prepare this fulfillment. The duration must be in RFC 3339 format (for example, \"P1W3D\").
	PrepTimeDuration string `json:"prep_time_duration,omitempty"`
	// A note to provide additional instructions about the pickup fulfillment displayed in the Square Point of Sale application and set by the API.
	Note string `json:"note,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	PlacedAt string `json:"placed_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was accepted. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	AcceptedAt string `json:"accepted_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	RejectedAt string `json:"rejected_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ReadyAt string `json:"ready_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment expired. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ExpiredAt string `json:"expired_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	PickedUpAt string `json:"picked_up_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CanceledAt string `json:"canceled_at,omitempty"`
	// A description of why the pickup was canceled. The maximum length: 100 characters.
	CancelReason string `json:"cancel_reason,omitempty"`
	// If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup.
	IsCurbsidePickup bool `json:"is_curbside_pickup,omitempty"`
	// Specific details for curbside pickup. These details can only be populated if `is_curbside_pickup` is set to `true`.
	CurbsidePickupDetails *FulfillmentPickupDetailsCurbsidePickupDetails `json:"curbside_pickup_details,omitempty"`
}

Contains details necessary to fulfill a pickup order.

type FulfillmentPickupDetailsCurbsidePickupDetails

type FulfillmentPickupDetailsCurbsidePickupDetails struct {
	// Specific details for curbside pickup, such as parking number and vehicle model.
	CurbsideDetails string `json:"curbside_details,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	BuyerArrivedAt string `json:"buyer_arrived_at,omitempty"`
}

Specific details for curbside pickup.

type FulfillmentPickupDetailsScheduleType

type FulfillmentPickupDetailsScheduleType string

FulfillmentPickupDetailsScheduleType : The schedule type of the pickup fulfillment.

const (
	SCHEDULED_FulfillmentPickupDetailsScheduleType FulfillmentPickupDetailsScheduleType = "SCHEDULED"
	ASAP_FulfillmentPickupDetailsScheduleType      FulfillmentPickupDetailsScheduleType = "ASAP"
)

List of FulfillmentPickupDetailsScheduleType

type FulfillmentRecipient

type FulfillmentRecipient struct {
	// The ID of the customer associated with the fulfillment.  If `customer_id` is provided, the fulfillment recipient's `display_name`, `email_address`, and `phone_number` are automatically populated from the targeted customer profile. If these fields are set in the request, the request values override the information from the customer profile. If the targeted customer profile does not contain the necessary information and these fields are left unset, the request results in an error.
	CustomerId string `json:"customer_id,omitempty"`
	// The display name of the fulfillment recipient. This field is required.  If provided, the display name overrides the corresponding customer profile value indicated by `customer_id`.
	DisplayName string `json:"display_name,omitempty"`
	// The email address of the fulfillment recipient.  If provided, the email address overrides the corresponding customer profile value indicated by `customer_id`.
	EmailAddress string `json:"email_address,omitempty"`
	// The phone number of the fulfillment recipient. This field is required.  If provided, the phone number overrides the corresponding customer profile value indicated by `customer_id`.
	PhoneNumber string `json:"phone_number,omitempty"`
	// The address of the fulfillment recipient. This field is required.  If provided, the address overrides the corresponding customer profile value indicated by `customer_id`.
	Address *Address `json:"address,omitempty"`
}

Information about the fulfillment recipient.

type FulfillmentShipmentDetails

type FulfillmentShipmentDetails struct {
	// Information about the person to receive this shipment fulfillment.
	Recipient *FulfillmentRecipient `json:"recipient,omitempty"`
	// The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
	Carrier string `json:"carrier,omitempty"`
	// A note with additional information for the shipping carrier.
	ShippingNote string `json:"shipping_note,omitempty"`
	// A description of the type of shipping product purchased from the carrier (such as First Class, Priority, or Express).
	ShippingType string `json:"shipping_type,omitempty"`
	// The reference number provided by the carrier to track the shipment's progress.
	TrackingNumber string `json:"tracking_number,omitempty"`
	// A link to the tracking webpage on the carrier's website.
	TrackingUrl string `json:"tracking_url,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the shipment was requested. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	PlacedAt string `json:"placed_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment was moved to the `RESERVED` state, which  indicates that preparation of this shipment has begun. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	InProgressAt string `json:"in_progress_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	PackagedAt string `json:"packaged_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the shipment is expected to be delivered to the shipping carrier. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ExpectedShippedAt string `json:"expected_shipped_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ShippedAt string `json:"shipped_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating the shipment was canceled. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CanceledAt string `json:"canceled_at,omitempty"`
	// A description of why the shipment was canceled.
	CancelReason string `json:"cancel_reason,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	FailedAt string `json:"failed_at,omitempty"`
	// A description of why the shipment failed to be completed.
	FailureReason string `json:"failure_reason,omitempty"`
}

Contains the details necessary to fulfill a shipment order.

type FulfillmentState

type FulfillmentState string

FulfillmentState : The current state of this fulfillment.

const (
	PROPOSED_FulfillmentState  FulfillmentState = "PROPOSED"
	RESERVED_FulfillmentState  FulfillmentState = "RESERVED"
	PREPARED_FulfillmentState  FulfillmentState = "PREPARED"
	COMPLETED_FulfillmentState FulfillmentState = "COMPLETED"
	CANCELED_FulfillmentState  FulfillmentState = "CANCELED"
	FAILED_FulfillmentState    FulfillmentState = "FAILED"
)

List of FulfillmentState

type FulfillmentType

type FulfillmentType string

FulfillmentType : The type of fulfillment.

const (
	PICKUP_FulfillmentType   FulfillmentType = "PICKUP"
	SHIPMENT_FulfillmentType FulfillmentType = "SHIPMENT"
	DELIVERY_FulfillmentType FulfillmentType = "DELIVERY"
)

List of FulfillmentType

type GetPaymentRefundRequest

type GetPaymentRefundRequest struct {
}

Describes a request to retrieve a refund using [GetPaymentRefund](https://developer.squareup.com/reference/square_2023-12-13/refunds-api/get-payment-refund).

type GetPaymentRefundResponse

type GetPaymentRefundResponse struct {
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The requested `PaymentRefund`.
	Refund *PaymentRefund `json:"refund,omitempty"`
}

Defines the response returned by [GetRefund](https://developer.squareup.com/reference/square_2023-12-13/refunds-api/get-payment-refund). Note: If there are errors processing the request, the refund field might not be present or it might be present in a FAILED state.

type GetPaymentRequest

type GetPaymentRequest struct {
}

Describes a request to retrieve a payment using [GetPayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/get-payment).

type GetPaymentResponse

type GetPaymentResponse struct {
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The requested `Payment`.
	Payment *Payment `json:"payment,omitempty"`
}

Defines the response returned by [GetPayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/get-payment).

type ListCustomersRequest

type ListCustomersRequest 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:"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 100, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Limit int32 `json:"limit,omitempty"`
	// Indicates how customers should be sorted.  The default value is `DEFAULT`.
	SortField string `json:"sort_field,omitempty"`
	// Indicates whether customers should be sorted in ascending (`ASC`) or descending (`DESC`) order.  The default value is `ASC`.
	SortOrder string `json:"sort_order,omitempty"`
	// Indicates whether to return the total count of customers in the `count` field of the response.  The default value is `false`.
	Count bool `json:"count,omitempty"`
}

Defines the query parameters that can be included in a request to the `ListCustomers` endpoint.

type ListCustomersResponse

type ListCustomersResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The customer profiles associated with the Square account or an empty object (`{}`) if none are found. Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are included in the response.
	Customers []Customer `json:"customers,omitempty"`
	// A pagination cursor to retrieve the next set of results for the original query. A cursor is only present if the request succeeded and additional results are available.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor string `json:"cursor,omitempty"`
	// The total count of customers associated with the Square account. Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is present only if `count` is set to `true` in the request.
	Count int64 `json:"count,omitempty"`
}

Defines the fields that are included in the response body of a request to the `ListCustomers` endpoint. Either `errors` or `customers` is present in a given response (never both).

type ListOrderCustomAttributeDefinitionsRequest

type ListOrderCustomAttributeDefinitionsRequest struct {
	// Requests that all of the custom attributes be returned, or only those that are read-only or read-write.
	VisibilityFilter string `json:"visibility_filter,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/working-with-apis/pagination).
	Cursor string `json:"cursor,omitempty"`
	// 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/working-with-apis/pagination).
	Limit int32 `json:"limit,omitempty"`
}

Represents a list request for order custom attribute definitions.

type ListOrderCustomAttributeDefinitionsResponse

type ListOrderCustomAttributeDefinitionsResponse struct {
	// The retrieved custom attribute definitions. If no custom attribute definitions are found, Square returns an empty object (`{}`).
	CustomAttributeDefinitions []CustomAttributeDefinition `json:"custom_attribute_definitions"`
	// The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request.  This field is present only if the request succeeded and additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
	Cursor string `json:"cursor,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from listing order custom attribute definitions.

type ListOrderCustomAttributesRequest

type ListOrderCustomAttributesRequest struct {
	// Requests that all of the custom attributes be returned, or only those that are read-only or read-write.
	VisibilityFilter string `json:"visibility_filter,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/working-with-apis/pagination).
	Cursor string `json:"cursor,omitempty"`
	// 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/working-with-apis/pagination).
	Limit int32 `json:"limit,omitempty"`
	// Indicates whether to return the [custom attribute definition](https://developer.squareup.com/reference/square_2023-12-13/objects/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:"with_definitions,omitempty"`
}

Represents a list request for order custom attributes.

type ListOrderCustomAttributesResponse

type ListOrderCustomAttributesResponse struct {
	// The retrieved custom attributes. If no custom attribute are found, Square returns an empty object (`{}`).
	CustomAttributes []CustomAttribute `json:"custom_attributes,omitempty"`
	// The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request.  This field is present only if the request succeeded and additional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
	Cursor string `json:"cursor,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from listing order custom attributes.

type ListPaymentRefundsRequest

type ListPaymentRefundsRequest struct {
	// Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339  format.  The range is determined using the `created_at` field for each `PaymentRefund`.   Default: The current time minus one year.
	BeginTime string `json:"begin_time,omitempty"`
	// Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339  format.  The range is determined using the `created_at` field for each `PaymentRefund`.  Default: The current time.
	EndTime string `json:"end_time,omitempty"`
	// The order in which results are listed by `PaymentRefund.created_at`: - `ASC` - Oldest to newest. - `DESC` - Newest to oldest (default).
	SortOrder string `json:"sort_order,omitempty"`
	// A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor string `json:"cursor,omitempty"`
	// Limit results to the location supplied. By default, results are returned for all locations associated with the seller.
	LocationId string `json:"location_id,omitempty"`
	// If provided, only refunds with the given status are returned. For a list of refund status values, see [PaymentRefund](https://developer.squareup.com/reference/square_2023-12-13/objects/PaymentRefund).  Default: If omitted, refunds are returned regardless of their status.
	Status string `json:"status,omitempty"`
	// If provided, only returns refunds whose payments have the indicated source type. Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`. For information about these payment source types, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).  Default: If omitted, refunds are returned regardless of the source type.
	SourceType string `json:"source_type,omitempty"`
	// The maximum number of results to be returned in a single page.  It is possible to receive fewer results than the specified limit on a given page.  If the supplied value is greater than 100, no more than 100 results are returned.  Default: 100
	Limit int32 `json:"limit,omitempty"`
}

Describes a request to list refunds using [ListPaymentRefunds](https://developer.squareup.com/reference/square_2023-12-13/refunds-api/list-payment-refunds). The maximum results per page is 100.

type ListPaymentRefundsResponse

type ListPaymentRefundsResponse struct {
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The list of requested refunds.
	Refunds []PaymentRefund `json:"refunds,omitempty"`
	// The pagination cursor to be used in a subsequent request. If empty, this is the final response.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor string `json:"cursor,omitempty"`
}

Defines the response returned by [ListPaymentRefunds](https://developer.squareup.com/reference/square_2023-12-13/refunds-api/list-payment-refunds). Either `errors` or `refunds` is present in a given response (never both).

type ListPaymentsRequest

type ListPaymentsRequest struct {
	// Indicates the start of the time range to retrieve payments for, in RFC 3339 format.   The range is determined using the `created_at` field for each Payment. Inclusive. Default: The current time minus one year.
	BeginTime string `json:"begin_time,omitempty"`
	// Indicates the end of the time range to retrieve payments for, in RFC 3339 format.  The  range is determined using the `created_at` field for each Payment.  Default: The current time.
	EndTime string `json:"end_time,omitempty"`
	// The order in which results are listed by `Payment.created_at`: - `ASC` - Oldest to newest. - `DESC` - Newest to oldest (default).
	SortOrder string `json:"sort_order,omitempty"`
	// A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor string `json:"cursor,omitempty"`
	// Limit results to the location supplied. By default, results are returned for the default (main) location associated with the seller.
	LocationId string `json:"location_id,omitempty"`
	// The exact amount in the `total_money` for a payment.
	Total int64 `json:"total,omitempty"`
	// The last four digits of a payment card.
	Last4 string `json:"last_4,omitempty"`
	// The brand of the payment card (for example, VISA).
	CardBrand string `json:"card_brand,omitempty"`
	// The maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page.  The default value of 100 is also the maximum allowed value. If the provided value is  greater than 100, it is ignored and the default value is used instead.  Default: `100`
	Limit int32 `json:"limit,omitempty"`
}

Describes a request to list payments using [ListPayments](https://developer.squareup.com/reference/square_2023-12-13/payments-api/list-payments). The maximum results per page is 100.

type ListPaymentsResponse

type ListPaymentsResponse struct {
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The requested list of payments.
	Payments []Payment `json:"payments,omitempty"`
	// The pagination cursor to be used in a subsequent request. If empty, this is the final response.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor string `json:"cursor,omitempty"`
}

Defines the response returned by [ListPayments](https://developer.squareup.com/reference/square_2023-12-13/payments-api/list-payments).

type ListTransactionsRequest

type ListTransactionsRequest struct {
	// The beginning of the requested reporting period, in RFC 3339 format.  See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.  Default value: The current time minus one year.
	BeginTime string `json:"begin_time,omitempty"`
	// The end of the requested reporting period, in RFC 3339 format.  See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.  Default value: The current time.
	EndTime string `json:"end_time,omitempty"`
	// The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first).  Default value: `DESC`
	SortOrder string `json:"sort_order,omitempty"`
	// 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 [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information.
	Cursor string `json:"cursor,omitempty"`
}

Defines the query parameters that can be included in a request to the [ListTransactions](https://developer.squareup.com/reference/square_2023-12-13/transactions-api/list-transactions) endpoint. Deprecated - recommend using [SearchOrders](https://developer.squareup.com/reference/square_2023-12-13/orders-api/search-orders)

type ListTransactionsResponse

type ListTransactionsResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// An array of transactions that match your query.
	Transactions []Transaction `json:"transactions,omitempty"`
	// A pagination cursor for retrieving the next set of results, if any remain. Provide this value as the `cursor` parameter in a subsequent request to this endpoint.  See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information.
	Cursor string `json:"cursor,omitempty"`
}

Defines the fields that are included in the response body of a request to the [ListTransactions](https://developer.squareup.com/reference/square_2023-12-13/transactions-api/list-transactions) endpoint. One of `errors` or `transactions` is present in a given response (never both).

type LoyaltyEventOrderFilter

type LoyaltyEventOrderFilter struct {
	// The ID of the [order](https://developer.squareup.com/reference/square_2023-12-13/objects/Order) associated with the event.
	OrderId string `json:"order_id"`
}

Filter events by the order associated with the event.

type MeasurementUnit

type MeasurementUnit struct {
	// A custom unit of measurement defined by the seller using the Point of Sale app or ad-hoc as an order line item.
	CustomUnit *MeasurementUnitCustom `json:"custom_unit,omitempty"`
	// Represents a standard area unit.
	AreaUnit string `json:"area_unit,omitempty"`
	// Represents a standard length unit.
	LengthUnit string `json:"length_unit,omitempty"`
	// Represents a standard volume unit.
	VolumeUnit string `json:"volume_unit,omitempty"`
	// Represents a standard unit of weight or mass.
	WeightUnit string `json:"weight_unit,omitempty"`
	// Reserved for API integrations that lack the ability to specify a real measurement unit
	GenericUnit string `json:"generic_unit,omitempty"`
	// Represents a standard unit of time.
	TimeUnit string `json:"time_unit,omitempty"`
	// Represents the type of the measurement unit.
	Type_ string `json:"type,omitempty"`
}

Represents a unit of measurement to use with a quantity, such as ounces or inches. Exactly one of the following fields are required: `custom_unit`, `area_unit`, `length_unit`, `volume_unit`, and `weight_unit`.

type MeasurementUnitArea

type MeasurementUnitArea string

MeasurementUnitArea : Unit of area used to measure a quantity.

const (
	IMPERIAL_ACRE_MeasurementUnitArea            MeasurementUnitArea = "IMPERIAL_ACRE"
	IMPERIAL_SQUARE_INCH_MeasurementUnitArea     MeasurementUnitArea = "IMPERIAL_SQUARE_INCH"
	IMPERIAL_SQUARE_FOOT_MeasurementUnitArea     MeasurementUnitArea = "IMPERIAL_SQUARE_FOOT"
	IMPERIAL_SQUARE_YARD_MeasurementUnitArea     MeasurementUnitArea = "IMPERIAL_SQUARE_YARD"
	IMPERIAL_SQUARE_MILE_MeasurementUnitArea     MeasurementUnitArea = "IMPERIAL_SQUARE_MILE"
	METRIC_SQUARE_CENTIMETER_MeasurementUnitArea MeasurementUnitArea = "METRIC_SQUARE_CENTIMETER"
	METRIC_SQUARE_METER_MeasurementUnitArea      MeasurementUnitArea = "METRIC_SQUARE_METER"
	METRIC_SQUARE_KILOMETER_MeasurementUnitArea  MeasurementUnitArea = "METRIC_SQUARE_KILOMETER"
)

List of MeasurementUnitArea

type MeasurementUnitCustom

type MeasurementUnitCustom struct {
	// The name of the custom unit, for example \"bushel\".
	Name string `json:"name"`
	// The abbreviation of the custom unit, such as \"bsh\" (bushel). This appears in the cart for the Point of Sale app, and in reports.
	Abbreviation string `json:"abbreviation"`
}

The information needed to define a custom unit, provided by the seller.

type MeasurementUnitGeneric

type MeasurementUnitGeneric string

MeasurementUnitGeneric :

const (
	UNIT_MeasurementUnitGeneric MeasurementUnitGeneric = "UNIT"
)

List of MeasurementUnitGeneric

type MeasurementUnitLength

type MeasurementUnitLength string

MeasurementUnitLength : The unit of length used to measure a quantity.

const (
	IMPERIAL_INCH_MeasurementUnitLength     MeasurementUnitLength = "IMPERIAL_INCH"
	IMPERIAL_FOOT_MeasurementUnitLength     MeasurementUnitLength = "IMPERIAL_FOOT"
	IMPERIAL_YARD_MeasurementUnitLength     MeasurementUnitLength = "IMPERIAL_YARD"
	IMPERIAL_MILE_MeasurementUnitLength     MeasurementUnitLength = "IMPERIAL_MILE"
	METRIC_MILLIMETER_MeasurementUnitLength MeasurementUnitLength = "METRIC_MILLIMETER"
	METRIC_CENTIMETER_MeasurementUnitLength MeasurementUnitLength = "METRIC_CENTIMETER"
	METRIC_METER_MeasurementUnitLength      MeasurementUnitLength = "METRIC_METER"
	METRIC_KILOMETER_MeasurementUnitLength  MeasurementUnitLength = "METRIC_KILOMETER"
)

List of MeasurementUnitLength

type MeasurementUnitTime

type MeasurementUnitTime string

MeasurementUnitTime : Unit of time used to measure a quantity (a duration).

const (
	MILLISECOND_MeasurementUnitTime MeasurementUnitTime = "GENERIC_MILLISECOND"
	SECOND_MeasurementUnitTime      MeasurementUnitTime = "GENERIC_SECOND"
	MINUTE_MeasurementUnitTime      MeasurementUnitTime = "GENERIC_MINUTE"
	HOUR_MeasurementUnitTime        MeasurementUnitTime = "GENERIC_HOUR"
	DAY_MeasurementUnitTime         MeasurementUnitTime = "GENERIC_DAY"
)

List of MeasurementUnitTime

type MeasurementUnitUnitType

type MeasurementUnitUnitType string

MeasurementUnitUnitType : Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum.

const (
	CUSTOM_MeasurementUnitUnitType  MeasurementUnitUnitType = "TYPE_CUSTOM"
	AREA_MeasurementUnitUnitType    MeasurementUnitUnitType = "TYPE_AREA"
	LENGTH_MeasurementUnitUnitType  MeasurementUnitUnitType = "TYPE_LENGTH"
	VOLUME_MeasurementUnitUnitType  MeasurementUnitUnitType = "TYPE_VOLUME"
	WEIGHT_MeasurementUnitUnitType  MeasurementUnitUnitType = "TYPE_WEIGHT"
	GENERIC_MeasurementUnitUnitType MeasurementUnitUnitType = "TYPE_GENERIC"
)

List of MeasurementUnitUnitType

type MeasurementUnitVolume

type MeasurementUnitVolume string

MeasurementUnitVolume : The unit of volume used to measure a quantity.

const (
	GENERIC_FLUID_OUNCE_MeasurementUnitVolume MeasurementUnitVolume = "GENERIC_FLUID_OUNCE"
	GENERIC_SHOT_MeasurementUnitVolume        MeasurementUnitVolume = "GENERIC_SHOT"
	GENERIC_CUP_MeasurementUnitVolume         MeasurementUnitVolume = "GENERIC_CUP"
	GENERIC_PINT_MeasurementUnitVolume        MeasurementUnitVolume = "GENERIC_PINT"
	GENERIC_QUART_MeasurementUnitVolume       MeasurementUnitVolume = "GENERIC_QUART"
	GENERIC_GALLON_MeasurementUnitVolume      MeasurementUnitVolume = "GENERIC_GALLON"
	IMPERIAL_CUBIC_INCH_MeasurementUnitVolume MeasurementUnitVolume = "IMPERIAL_CUBIC_INCH"
	IMPERIAL_CUBIC_FOOT_MeasurementUnitVolume MeasurementUnitVolume = "IMPERIAL_CUBIC_FOOT"
	IMPERIAL_CUBIC_YARD_MeasurementUnitVolume MeasurementUnitVolume = "IMPERIAL_CUBIC_YARD"
	METRIC_MILLILITER_MeasurementUnitVolume   MeasurementUnitVolume = "METRIC_MILLILITER"
	METRIC_LITER_MeasurementUnitVolume        MeasurementUnitVolume = "METRIC_LITER"
)

List of MeasurementUnitVolume

type MeasurementUnitWeight

type MeasurementUnitWeight string

MeasurementUnitWeight : Unit of weight used to measure a quantity.

const (
	IMPERIAL_WEIGHT_OUNCE_MeasurementUnitWeight MeasurementUnitWeight = "IMPERIAL_WEIGHT_OUNCE"
	IMPERIAL_POUND_MeasurementUnitWeight        MeasurementUnitWeight = "IMPERIAL_POUND"
	IMPERIAL_STONE_MeasurementUnitWeight        MeasurementUnitWeight = "IMPERIAL_STONE"
	METRIC_MILLIGRAM_MeasurementUnitWeight      MeasurementUnitWeight = "METRIC_MILLIGRAM"
	METRIC_GRAM_MeasurementUnitWeight           MeasurementUnitWeight = "METRIC_GRAM"
	METRIC_KILOGRAM_MeasurementUnitWeight       MeasurementUnitWeight = "METRIC_KILOGRAM"
)

List of MeasurementUnitWeight

type ModelError

type ModelError struct {
	// The high-level category for the error.
	Category string `json:"category"`
	// The specific code of the error.
	Code string `json:"code"`
	// A human-readable description of the error for debugging purposes.
	Detail string `json:"detail,omitempty"`
	// The name of the field provided in the original request (if any) that the error pertains to.
	Field string `json:"field,omitempty"`
}

Represents an error encountered during a request to the Connect API. See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information.

type ModelRange

type ModelRange struct {
	// The lower bound of the number range. At least one of `min` or `max` must be specified. If unspecified, the results will have no minimum value.
	Min string `json:"min,omitempty"`
	// The upper bound of the number range. At least one of `min` or `max` must be specified. If unspecified, the results will have no maximum value.
	Max string `json:"max,omitempty"`
}

The range of a number value between the specified lower and upper bounds.

type Money

type Money struct {
	// The amount of money, in the smallest denomination of the currency indicated by `currency`. For example, when `currency` is `USD`, `amount` is in cents. Monetary amounts can be positive or negative. See the specific field description to determine the meaning of the sign in a particular case.
	Amount int64 `json:"amount,omitempty"`
	// The type of currency, in __ISO 4217 format__. For example, the currency code for US dollars is `USD`.  See [Currency](https://developer.squareup.com/reference/square_2023-12-13/enums/Currency) for possible values.
	Currency string `json:"currency,omitempty"`
}

Represents an amount of money. `Money` fields can be signed or unsigned. Fields that do not explicitly define whether they are signed or unsigned are considered unsigned and can only hold positive amounts. For signed fields, the sign of the value indicates the purpose of the money transfer. See [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) for more information.

type Order

type Order struct {
	// The order's unique ID.
	Id string `json:"id,omitempty"`
	// The ID of the seller location that this order is associated with.
	LocationId string `json:"location_id"`
	// A client-specified ID to associate an entity in another system with this order.
	ReferenceId string `json:"reference_id,omitempty"`
	// The origination details of the order.
	Source *OrderSource `json:"source,omitempty"`
	// The ID of the [customer](https://developer.squareup.com/reference/square_2023-12-13/objects/Customer) associated with the order.  You should specify a `customer_id` on the order (or the payment) to ensure that transactions are reliably linked to customers. Omitting this field might result in the creation of new [instant profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles).
	CustomerId string `json:"customer_id,omitempty"`
	// The line items included in the order.
	LineItems []OrderLineItem `json:"line_items,omitempty"`
	// The list of all taxes associated with the order.  Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an `OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes with `ORDER` scope, the server generates an `OrderLineItemAppliedTax` for every line item.  On reads, each tax in the list includes the total amount of that tax applied to the order.  __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated `line_items.taxes` field results in an error. Use `line_items.applied_taxes` instead.
	Taxes []OrderLineItemTax `json:"taxes,omitempty"`
	// The list of all discounts associated with the order.  Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`, an `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to. For discounts with `ORDER` scope, the server generates an `OrderLineItemAppliedDiscount` for every line item.  __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated `line_items.discounts` field results in an error. Use `line_items.applied_discounts` instead.
	Discounts []OrderLineItemDiscount `json:"discounts,omitempty"`
	// A list of service charges applied to the order.
	ServiceCharges []OrderServiceCharge `json:"service_charges,omitempty"`
	// Details about order fulfillment.  Orders can only be created with at most one fulfillment. However, orders returned by the API might contain multiple fulfillments.
	Fulfillments []Fulfillment `json:"fulfillments,omitempty"`
	// A collection of items from sale orders being returned in this one. Normally part of an itemized return or exchange. There is exactly one `Return` object per sale `Order` being referenced.
	Returns []OrderReturn `json:"returns,omitempty"`
	// The rollup of the returned money amounts.
	ReturnAmounts *OrderMoneyAmounts `json:"return_amounts,omitempty"`
	// The net money amounts (sale money - return money).
	NetAmounts *OrderMoneyAmounts `json:"net_amounts,omitempty"`
	// A positive rounding adjustment to the total of the order. This adjustment is commonly used to apply cash rounding when the minimum unit of account is smaller than the lowest physical denomination of the currency.
	RoundingAdjustment *OrderRoundingAdjustment `json:"rounding_adjustment,omitempty"`
	// The tenders that were used to pay for the order.
	Tenders []Tender `json:"tenders,omitempty"`
	// The refunds that are part of this order.
	Refunds []Refund `json:"refunds,omitempty"`
	// Application-defined data attached to this order. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details).  Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character.  Values have a maximum length of 255 characters.  An application can have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  For more information, see  [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
	// The timestamp for when the order was created, in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CreatedAt string `json:"created_at,omitempty"`
	// The timestamp for when the order was last updated, in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	UpdatedAt string `json:"updated_at,omitempty"`
	// The timestamp for when the order reached a terminal [state](https://developer.squareup.com/reference/square_2023-12-13/enums/OrderState), in RFC 3339 format (for example \"2016-09-04T23:59:33.123Z\").
	ClosedAt string `json:"closed_at,omitempty"`
	// The current state of the order.
	State string `json:"state,omitempty"`
	// The version number, which is incremented each time an update is committed to the order. Orders not created through the API do not include a version number and therefore cannot be updated.  [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders).
	Version int32 `json:"version,omitempty"`
	// The total amount of money to collect for the order.
	TotalMoney *Money `json:"total_money,omitempty"`
	// The total amount of tax money to collect for the order.
	TotalTaxMoney *Money `json:"total_tax_money,omitempty"`
	// The total amount of discount money to collect for the order.
	TotalDiscountMoney *Money `json:"total_discount_money,omitempty"`
	// The total amount of tip money to collect for the order.
	TotalTipMoney *Money `json:"total_tip_money,omitempty"`
	// The total amount of money collected in service charges for the order.  Note: `total_service_charge_money` is the sum of `applied_money` fields for each individual service charge. Therefore, `total_service_charge_money` only includes inclusive tax amounts, not additive tax amounts.
	TotalServiceChargeMoney *Money `json:"total_service_charge_money,omitempty"`
	// A short-term identifier for the order (such as a customer first name, table number, or auto-generated order number that resets daily).
	TicketName string `json:"ticket_name,omitempty"`
	// Pricing options for an order. The options affect how the order's price is calculated. They can be used, for example, to apply automatic price adjustments that are based on preconfigured [pricing rules](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogPricingRule).
	PricingOptions *OrderPricingOptions `json:"pricing_options,omitempty"`
	// A set-like list of Rewards that have been added to the Order.
	Rewards []OrderReward `json:"rewards,omitempty"`
	// The net amount of money due on the order.
	NetAmountDueMoney *Money `json:"net_amount_due_money,omitempty"`
}

Contains all information related to a single order to process with Square, including line items that specify the products to purchase. `Order` objects also include information about any associated tenders, refunds, and returns. All Connect V2 Transactions have all been converted to Orders including all associated itemization data.

type OrderCreated

type OrderCreated struct {
	// The order's unique ID.
	OrderId string `json:"order_id,omitempty"`
	// The version number, which is incremented each time an update is committed to the order. Orders that were not created through the API do not include a version number and therefore cannot be updated.  [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)
	Version int32 `json:"version,omitempty"`
	// The ID of the seller location that this order is associated with.
	LocationId string `json:"location_id,omitempty"`
	// The state of the order.
	State string `json:"state,omitempty"`
	// The timestamp for when the order was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
}

type OrderCreatedObject

type OrderCreatedObject struct {
	// Information about the created order.
	OrderCreated *OrderCreated `json:"order_created,omitempty"`
}

type OrderEntry

type OrderEntry struct {
	// The ID of the order.
	OrderId string `json:"order_id,omitempty"`
	// The version number, which is incremented each time an update is committed to the order. Orders that were not created through the API do not include a version number and therefore cannot be updated.  [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)
	Version int32 `json:"version,omitempty"`
	// The location ID the order belongs to.
	LocationId string `json:"location_id,omitempty"`
}

A lightweight description of an [order](https://developer.squareup.com/reference/square_2023-12-13/objects/Order) that is returned when `returned_entries` is `true` on a SearchOrdersRequest(https://developer.squareup.com/reference/square_2023-12-13/orders-api/search-orders).

type OrderFulfillment

type OrderFulfillment struct {
	// A unique ID that identifies the fulfillment only within this order.
	Uid string `json:"uid,omitempty"`
	// The type of the fulfillment.
	Type_ string `json:"type,omitempty"`
	// The state of the fulfillment.
	State string `json:"state,omitempty"`
	// Describes what order line items this fulfillment applies to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.
	LineItemApplication string `json:"line_item_application,omitempty"`
	// A list of entries pertaining to the fulfillment of an order. Each entry must reference a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to fulfill. Multiple entries can reference the same line item `uid`, as long as the total quantity among all fulfillment entries referencing a single line item does not exceed the quantity of the order's line item itself. An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`, `CANCELED`, or `FAILED`. Fulfillments can be created and completed independently before order completion.
	Entries []OrderFulfillmentFulfillmentEntry `json:"entries,omitempty"`
	// Application-defined data attached to this fulfillment. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details). Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character. Values have a maximum length of 255 characters. An application can have up to 10 entries per metadata field. Entries written by applications are private and can only be read or modified by the same application. For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
	// Contains details for a pickup fulfillment. These details are required when the fulfillment type is `PICKUP`.
	PickupDetails *OrderFulfillmentPickupDetails `json:"pickup_details,omitempty"`
	// Contains details for a shipment fulfillment. These details are required when the fulfillment type is `SHIPMENT`. A shipment fulfillment's relationship to fulfillment `state`: `PROPOSED`: A shipment is requested. `RESERVED`: Fulfillment accepted. Shipment processing. `PREPARED`: Shipment packaged. Shipping label created. `COMPLETED`: Package has been shipped. `CANCELED`: Shipment has been canceled. `FAILED`: Shipment has failed.
	ShipmentDetails *OrderFulfillmentShipmentDetails `json:"shipment_details,omitempty"`
	// Describes delivery details of an order fulfillment.
	DeliveryDetails *OrderFulfillmentDeliveryDetails `json:"delivery_details,omitempty"`
}

Contains details about how to fulfill this order. Orders can only be created with at most one fulfillment using the API. However, orders returned by the Orders API might contain multiple fulfillments because sellers can create multiple fulfillments using Square products such as Square Online.

type OrderFulfillmentDeliveryDetails

type OrderFulfillmentDeliveryDetails struct {
	// The contact information for the person to receive the fulfillment.
	Recipient *OrderFulfillmentRecipient `json:"recipient,omitempty"`
	// Indicates the fulfillment delivery schedule type. If `SCHEDULED`, then `deliver_at` is required. If `ASAP`, then `prep_time_duration` is required. The default is `SCHEDULED`.
	ScheduleType string `json:"schedule_type,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\"). Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".
	PlacedAt string `json:"placed_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) that represents the start of the delivery period. When the fulfillment `schedule_type` is `ASAP`, the field is automatically set to the current time plus the `prep_time_duration`. Otherwise, the application can set this field while the fulfillment `state` is `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`).  The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	DeliverAt string `json:"deliver_at,omitempty"`
	// The duration of time it takes to prepare and deliver this fulfillment. The timestamp must be in RFC 3339 format (for example, \"P1W3D\").
	PrepTimeDuration string `json:"prep_time_duration,omitempty"`
	// The time period after the `deliver_at` timestamp in which to deliver the order. Applications can set this field when the fulfillment `state` is `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). The timestamp must be in RFC 3339 format (for example, \"P1W3D\").
	DeliveryWindowDuration string `json:"delivery_window_duration,omitempty"`
	// Provides additional instructions about the delivery fulfillment. It is displayed in the Square Point of Sale application and set by the API.
	Note string `json:"note,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicates when the seller completed the fulfillment. This field is automatically set when  fulfillment `state` changes to `COMPLETED`. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CompletedAt string `json:"completed_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicates when the seller started processing the fulfillment. This field is automatically set when the fulfillment `state` changes to `RESERVED`. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	InProgressAt string `json:"in_progress_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was rejected. This field is automatically set when the fulfillment `state` changes to `FAILED`. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	RejectedAt string `json:"rejected_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the seller marked the fulfillment as ready for courier pickup. This field is automatically set when the fulfillment `state` changes to PREPARED. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ReadyAt string `json:"ready_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was delivered to the recipient. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	DeliveredAt string `json:"delivered_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was canceled. This field is automatically set when the fulfillment `state` changes to `CANCELED`.  The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CanceledAt string `json:"canceled_at,omitempty"`
	// The delivery cancellation reason. Max length: 100 characters.
	CancelReason string `json:"cancel_reason,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when an order can be picked up by the courier for delivery. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CourierPickupAt string `json:"courier_pickup_at,omitempty"`
	// The period of time in which the order should be picked up by the courier after the `courier_pickup_at` timestamp. The time must be in RFC 3339 format (for example, \"P1W3D\").
	CourierPickupWindowDuration string `json:"courier_pickup_window_duration,omitempty"`
	// Whether the delivery is preferred to be no contact.
	IsNoContactDelivery bool `json:"is_no_contact_delivery,omitempty"`
	// A note to provide additional instructions about how to deliver the order.
	DropoffNotes string `json:"dropoff_notes,omitempty"`
	// The name of the courier provider.
	CourierProviderName string `json:"courier_provider_name,omitempty"`
	// The support phone number of the courier.
	CourierSupportPhoneNumber string `json:"courier_support_phone_number,omitempty"`
	// The identifier for the delivery created by Square.
	SquareDeliveryId string `json:"square_delivery_id,omitempty"`
	// The identifier for the delivery created by the third-party courier service.
	ExternalDeliveryId string `json:"external_delivery_id,omitempty"`
	// The flag to indicate the delivery is managed by a third party (ie DoorDash), which means we may not receive all recipient information for PII purposes.
	ManagedDelivery bool `json:"managed_delivery,omitempty"`
}

Describes delivery details of an order fulfillment.

type OrderFulfillmentDeliveryDetailsScheduleType

type OrderFulfillmentDeliveryDetailsScheduleType string

OrderFulfillmentDeliveryDetailsScheduleType : The schedule type of the delivery fulfillment.

const (
	SCHEDULED_OrderFulfillmentDeliveryDetailsScheduleType OrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED"
	ASAP_OrderFulfillmentDeliveryDetailsScheduleType      OrderFulfillmentDeliveryDetailsScheduleType = "ASAP"
)

List of OrderFulfillmentDeliveryDetailsScheduleType

type OrderFulfillmentFulfillmentEntry

type OrderFulfillmentFulfillmentEntry struct {
	// A unique ID that identifies the fulfillment entry only within this order.
	Uid string `json:"uid,omitempty"`
	// The `uid` from the order line item.
	LineItemUid string `json:"line_item_uid"`
	// The quantity of the line item being fulfilled, formatted as a decimal number. For example, `\"3\"`. Fulfillments for line items with a `quantity_unit` can have non-integer quantities. For example, `\"1.70000\"`.
	Quantity string `json:"quantity"`
	// Application-defined data attached to this fulfillment entry. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details). Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character. Values have a maximum length of 255 characters. An application can have up to 10 entries per metadata field. Entries written by applications are private and can only be read or modified by the same application. For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
}

Links an order line item to a fulfillment. Each entry must reference a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to fulfill.

type OrderFulfillmentFulfillmentLineItemApplication

type OrderFulfillmentFulfillmentLineItemApplication string

OrderFulfillmentFulfillmentLineItemApplication : The `line_item_application` describes what order line items this fulfillment applies to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.

const (
	ALL_OrderFulfillmentFulfillmentLineItemApplication        OrderFulfillmentFulfillmentLineItemApplication = "ALL"
	ENTRY_LIST_OrderFulfillmentFulfillmentLineItemApplication OrderFulfillmentFulfillmentLineItemApplication = "ENTRY_LIST"
)

List of OrderFulfillmentFulfillmentLineItemApplication

type OrderFulfillmentPickupDetails

type OrderFulfillmentPickupDetails struct {
	// Information about the person to pick up this fulfillment from a physical location.
	Recipient *OrderFulfillmentRecipient `json:"recipient,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment expires if it is not accepted. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\"). The expiration time can only be set up to 7 days in the future. If `expires_at` is not set, this pickup fulfillment is automatically accepted when placed.
	ExpiresAt string `json:"expires_at,omitempty"`
	// The duration of time after which an open and accepted pickup fulfillment is automatically moved to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, \"P1W3D\"). If not set, this pickup fulfillment remains accepted until it is canceled or completed.
	AutoCompleteDuration string `json:"auto_complete_duration,omitempty"`
	// The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`.
	ScheduleType string `json:"schedule_type,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\". For fulfillments with the schedule type `ASAP`, this is automatically set to the current time plus the expected duration to prepare the fulfillment.
	PickupAt string `json:"pickup_at,omitempty"`
	// The window of time in which the order should be picked up after the `pickup_at` timestamp. Must be in RFC 3339 duration format, e.g., \"P1W3D\". Can be used as an informational guideline for merchants.
	PickupWindowDuration string `json:"pickup_window_duration,omitempty"`
	// The duration of time it takes to prepare this fulfillment. The duration must be in RFC 3339 format (for example, \"P1W3D\").
	PrepTimeDuration string `json:"prep_time_duration,omitempty"`
	// A note to provide additional instructions about the pickup fulfillment displayed in the Square Point of Sale application and set by the API.
	Note string `json:"note,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	PlacedAt string `json:"placed_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was accepted. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	AcceptedAt string `json:"accepted_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	RejectedAt string `json:"rejected_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ReadyAt string `json:"ready_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment expired. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ExpiredAt string `json:"expired_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	PickedUpAt string `json:"picked_up_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CanceledAt string `json:"canceled_at,omitempty"`
	// A description of why the pickup was canceled. The maximum length: 100 characters.
	CancelReason string `json:"cancel_reason,omitempty"`
	// If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup.
	IsCurbsidePickup bool `json:"is_curbside_pickup,omitempty"`
	// Specific details for curbside pickup. These details can only be populated if `is_curbside_pickup` is set to `true`.
	CurbsidePickupDetails *OrderFulfillmentPickupDetailsCurbsidePickupDetails `json:"curbside_pickup_details,omitempty"`
}

Contains details necessary to fulfill a pickup order.

type OrderFulfillmentPickupDetailsCurbsidePickupDetails

type OrderFulfillmentPickupDetailsCurbsidePickupDetails struct {
	// Specific details for curbside pickup, such as parking number and vehicle model.
	CurbsideDetails string `json:"curbside_details,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	BuyerArrivedAt string `json:"buyer_arrived_at,omitempty"`
}

Specific details for curbside pickup.

type OrderFulfillmentPickupDetailsScheduleType

type OrderFulfillmentPickupDetailsScheduleType string

OrderFulfillmentPickupDetailsScheduleType : The schedule type of the pickup fulfillment.

const (
	SCHEDULED_OrderFulfillmentPickupDetailsScheduleType OrderFulfillmentPickupDetailsScheduleType = "SCHEDULED"
	ASAP_OrderFulfillmentPickupDetailsScheduleType      OrderFulfillmentPickupDetailsScheduleType = "ASAP"
)

List of OrderFulfillmentPickupDetailsScheduleType

type OrderFulfillmentRecipient

type OrderFulfillmentRecipient struct {
	// The ID of the customer associated with the fulfillment. If `customer_id` is provided, the fulfillment recipient's `display_name`, `email_address`, and `phone_number` are automatically populated from the targeted customer profile. If these fields are set in the request, the request values override the information from the customer profile. If the targeted customer profile does not contain the necessary information and these fields are left unset, the request results in an error.
	CustomerId string `json:"customer_id,omitempty"`
	// The display name of the fulfillment recipient. This field is required. If provided, the display name overrides the corresponding customer profile value indicated by `customer_id`.
	DisplayName string `json:"display_name,omitempty"`
	// The email address of the fulfillment recipient. If provided, the email address overrides the corresponding customer profile value indicated by `customer_id`.
	EmailAddress string `json:"email_address,omitempty"`
	// The phone number of the fulfillment recipient. This field is required. If provided, the phone number overrides the corresponding customer profile value indicated by `customer_id`.
	PhoneNumber string `json:"phone_number,omitempty"`
	// The address of the fulfillment recipient. This field is required. If provided, the address overrides the corresponding customer profile value indicated by `customer_id`.
	Address *Address `json:"address,omitempty"`
}

Information about the fulfillment recipient.

type OrderFulfillmentShipmentDetails

type OrderFulfillmentShipmentDetails struct {
	// Information about the person to receive this shipment fulfillment.
	Recipient *OrderFulfillmentRecipient `json:"recipient,omitempty"`
	// The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
	Carrier string `json:"carrier,omitempty"`
	// A note with additional information for the shipping carrier.
	ShippingNote string `json:"shipping_note,omitempty"`
	// A description of the type of shipping product purchased from the carrier (such as First Class, Priority, or Express).
	ShippingType string `json:"shipping_type,omitempty"`
	// The reference number provided by the carrier to track the shipment's progress.
	TrackingNumber string `json:"tracking_number,omitempty"`
	// A link to the tracking webpage on the carrier's website.
	TrackingUrl string `json:"tracking_url,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the shipment was requested. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	PlacedAt string `json:"placed_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment was moved to the `RESERVED` state, which  indicates that preparation of this shipment has begun. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	InProgressAt string `json:"in_progress_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	PackagedAt string `json:"packaged_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the shipment is expected to be delivered to the shipping carrier. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ExpectedShippedAt string `json:"expected_shipped_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	ShippedAt string `json:"shipped_at,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating the shipment was canceled. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	CanceledAt string `json:"canceled_at,omitempty"`
	// A description of why the shipment was canceled.
	CancelReason string `json:"cancel_reason,omitempty"`
	// The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").
	FailedAt string `json:"failed_at,omitempty"`
	// A description of why the shipment failed to be completed.
	FailureReason string `json:"failure_reason,omitempty"`
}

Contains the details necessary to fulfill a shipment order.

type OrderFulfillmentState

type OrderFulfillmentState string

OrderFulfillmentState : The current state of this fulfillment.

const (
	PROPOSED_OrderFulfillmentState  OrderFulfillmentState = "PROPOSED"
	RESERVED_OrderFulfillmentState  OrderFulfillmentState = "RESERVED"
	PREPARED_OrderFulfillmentState  OrderFulfillmentState = "PREPARED"
	COMPLETED_OrderFulfillmentState OrderFulfillmentState = "COMPLETED"
	CANCELED_OrderFulfillmentState  OrderFulfillmentState = "CANCELED"
	FAILED_OrderFulfillmentState    OrderFulfillmentState = "FAILED"
)

List of OrderFulfillmentState

type OrderFulfillmentType

type OrderFulfillmentType string

OrderFulfillmentType : The type of fulfillment.

const (
	PICKUP_OrderFulfillmentType   OrderFulfillmentType = "PICKUP"
	SHIPMENT_OrderFulfillmentType OrderFulfillmentType = "SHIPMENT"
	DELIVERY_OrderFulfillmentType OrderFulfillmentType = "DELIVERY"
)

List of OrderFulfillmentType

type OrderFulfillmentUpdated

type OrderFulfillmentUpdated struct {
	// The order's unique ID.
	OrderId string `json:"order_id,omitempty"`
	// The version number, which is incremented each time an update is committed to the order. Orders that were not created through the API do not include a version number and therefore cannot be updated.  [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)
	Version int32 `json:"version,omitempty"`
	// The ID of the seller location that this order is associated with.
	LocationId string `json:"location_id,omitempty"`
	// The state of the order.
	State string `json:"state,omitempty"`
	// The timestamp for when the order was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The timestamp for when the order was last updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
	// The fulfillments that were updated with this version change.
	FulfillmentUpdate []OrderFulfillmentUpdatedUpdate `json:"fulfillment_update,omitempty"`
}

type OrderFulfillmentUpdatedObject

type OrderFulfillmentUpdatedObject struct {
	// Information about the updated order fulfillment.
	OrderFulfillmentUpdated *OrderFulfillmentUpdated `json:"order_fulfillment_updated,omitempty"`
}

type OrderFulfillmentUpdatedUpdate

type OrderFulfillmentUpdatedUpdate struct {
	// A unique ID that identifies the fulfillment only within this order.
	FulfillmentUid string `json:"fulfillment_uid,omitempty"`
	// The state of the fulfillment before the change. The state is not populated if the fulfillment is created with this new `Order` version.
	OldState string `json:"old_state,omitempty"`
	// The state of the fulfillment after the change. The state might be equal to `old_state` if a non-state field was changed on the fulfillment (such as the tracking number).
	NewState string `json:"new_state,omitempty"`
}

Information about fulfillment updates.

type OrderLineItem

type OrderLineItem struct {
	// A unique ID that identifies the line item only within this order.
	Uid string `json:"uid,omitempty"`
	// The name of the line item.
	Name string `json:"name,omitempty"`
	// The quantity purchased, formatted as a decimal number. For example, `\"3\"`.  Line items with a quantity of `\"0\"` are automatically removed when paying for or otherwise completing the order.  Line items with a `quantity_unit` can have non-integer quantities. For example, `\"1.70000\"`.
	Quantity string `json:"quantity"`
	// The unit and precision that this line item's quantity is measured in.
	QuantityUnit *OrderQuantityUnit `json:"quantity_unit,omitempty"`
	// The note of the line item.
	Note string `json:"note,omitempty"`
	// The [CatalogItemVariation](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogItemVariation) ID applied to this line item.
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this line item references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The name of the variation applied to this line item.
	VariationName string `json:"variation_name,omitempty"`
	// The type of line item: an itemized sale, a non-itemized sale (custom amount), or the activation or reloading of a gift card.
	ItemType string `json:"item_type,omitempty"`
	// Application-defined data attached to this line item. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details).  Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character.  Values have a maximum length of 255 characters.  An application can have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
	// The [CatalogModifier](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogModifier)s applied to this line item.
	Modifiers []OrderLineItemModifier `json:"modifiers,omitempty"`
	// The list of references to taxes applied to this line item. Each `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level `OrderLineItemTax` applied to the line item. On reads, the amount applied is populated.  An `OrderLineItemAppliedTax` is automatically created on every line item for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax` records for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any line items.  To change the amount of a tax, modify the referenced top-level tax.
	AppliedTaxes []OrderLineItemAppliedTax `json:"applied_taxes,omitempty"`
	// The list of references to discounts applied to this line item. Each `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level `OrderLineItemDiscounts` applied to the line item. On reads, the amount applied is populated.  An `OrderLineItemAppliedDiscount` is automatically created on every line item for all `ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any line items.  To change the amount of a discount, modify the referenced top-level discount.
	AppliedDiscounts []OrderLineItemAppliedDiscount `json:"applied_discounts,omitempty"`
	// The list of references to service charges applied to this line item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a top-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is populated.  To change the amount of a service charge, modify the referenced top-level service charge.
	AppliedServiceCharges []OrderLineItemAppliedServiceCharge `json:"applied_service_charges,omitempty"`
	// The base price for a single unit of the line item.
	BasePriceMoney *Money `json:"base_price_money,omitempty"`
	// The total price of all item variations sold in this line item. The price is calculated as `base_price_money` multiplied by `quantity`. It does not include modifiers.
	VariationTotalPriceMoney *Money `json:"variation_total_price_money,omitempty"`
	// The amount of money made in gross sales for this line item. The amount is calculated as the sum of the variation's total price and each modifier's total price.
	GrossSalesMoney *Money `json:"gross_sales_money,omitempty"`
	// The total amount of tax money to collect for the line item.
	TotalTaxMoney *Money `json:"total_tax_money,omitempty"`
	// The total amount of discount money to collect for the line item.
	TotalDiscountMoney *Money `json:"total_discount_money,omitempty"`
	// The total amount of money to collect for this line item.
	TotalMoney *Money `json:"total_money,omitempty"`
	// Describes pricing adjustments that are blocked from automatic application to a line item. For more information, see [Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts).
	PricingBlocklists *OrderLineItemPricingBlocklists `json:"pricing_blocklists,omitempty"`
	// The total amount of apportioned service charge money to collect for the line item.
	TotalServiceChargeMoney *Money `json:"total_service_charge_money,omitempty"`
}

Represents a line item in an order. Each line item describes a different product to purchase, with its own quantity and price details.

type OrderLineItemAppliedDiscount

type OrderLineItemAppliedDiscount struct {
	// A unique ID that identifies the applied discount only within this order.
	Uid string `json:"uid,omitempty"`
	// The `uid` of the discount that the applied discount represents. It must reference a discount present in the `order.discounts` field.  This field is immutable. To change which discounts apply to a line item, you must delete the discount and re-add it as a new `OrderLineItemAppliedDiscount`.
	DiscountUid string `json:"discount_uid"`
	// The amount of money applied by the discount to the line item.
	AppliedMoney *Money `json:"applied_money,omitempty"`
}

Represents an applied portion of a discount to a line item in an order. Order scoped discounts have automatically applied discounts present for each line item. Line-item scoped discounts must have applied discounts added manually for any applicable line items. The corresponding applied money is automatically computed based on participating line items.

type OrderLineItemAppliedServiceCharge

type OrderLineItemAppliedServiceCharge struct {
	// A unique ID that identifies the applied service charge only within this order.
	Uid string `json:"uid,omitempty"`
	// The `uid` of the service charge that the applied service charge represents. It must reference a service charge present in the `order.service_charges` field.  This field is immutable. To change which service charges apply to a line item, delete and add a new `OrderLineItemAppliedServiceCharge`.
	ServiceChargeUid string `json:"service_charge_uid"`
	// The amount of money applied by the service charge to the line item.
	AppliedMoney *Money `json:"applied_money,omitempty"`
}

type OrderLineItemAppliedTax

type OrderLineItemAppliedTax struct {
	// A unique ID that identifies the applied tax only within this order.
	Uid string `json:"uid,omitempty"`
	// The `uid` of the tax for which this applied tax represents. It must reference a tax present in the `order.taxes` field.  This field is immutable. To change which taxes apply to a line item, delete and add a new `OrderLineItemAppliedTax`.
	TaxUid string `json:"tax_uid"`
	// The amount of money applied by the tax to the line item.
	AppliedMoney *Money `json:"applied_money,omitempty"`
}

Represents an applied portion of a tax to a line item in an order. Order-scoped taxes automatically include the applied taxes in each line item. Line item taxes must be referenced from any applicable line items. The corresponding applied money is automatically computed, based on the set of participating line items.

type OrderLineItemDiscount

type OrderLineItemDiscount struct {
	// A unique ID that identifies the discount only within this order.
	Uid string `json:"uid,omitempty"`
	// The catalog object ID referencing [CatalogDiscount](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogDiscount).
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this discount references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The discount's name.
	Name string `json:"name,omitempty"`
	// The type of the discount.  Discounts that do not reference a catalog object ID must have a type of `FIXED_PERCENTAGE` or `FIXED_AMOUNT`.
	Type_ string `json:"type,omitempty"`
	// The percentage of the discount, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%.  `percentage` is not set for amount-based discounts.
	Percentage string `json:"percentage,omitempty"`
	// The total declared monetary amount of the discount.  `amount_money` is not set for percentage-based discounts.
	AmountMoney *Money `json:"amount_money,omitempty"`
	// The amount of discount actually applied to the line item.  The amount represents the amount of money applied as a line-item scoped discount. When an amount-based discount is scoped to the entire order, the value of `applied_money` is different than `amount_money` because the total amount of the discount is distributed across all line items.
	AppliedMoney *Money `json:"applied_money,omitempty"`
	// Application-defined data attached to this discount. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details).  Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character.  Values have a maximum length of 255 characters.  An application can have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
	// Indicates the level at which the discount applies. For `ORDER` scoped discounts, Square generates references in `applied_discounts` on all order line items that do not have them. For `LINE_ITEM` scoped discounts, the discount only applies to line items with a discount reference in their `applied_discounts` field.  This field is immutable. To change the scope of a discount, you must delete the discount and re-add it as a new discount.
	Scope string `json:"scope,omitempty"`
	// The reward IDs corresponding to this discount. The application and specification of discounts that have `reward_ids` are completely controlled by the backing criteria corresponding to the reward tiers of the rewards that are added to the order through the Loyalty API. To manually unapply discounts that are the result of added rewards, the rewards must be removed from the order through the Loyalty API.
	RewardIds []string `json:"reward_ids,omitempty"`
	// The object ID of a [pricing rule](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogPricingRule) to be applied automatically to this discount. The specification and application of the discounts, to which a `pricing_rule_id` is assigned, are completely controlled by the corresponding pricing rule.
	PricingRuleId string `json:"pricing_rule_id,omitempty"`
}

Represents a discount that applies to one or more line items in an order. Fixed-amount, order-scoped discounts are distributed across all non-zero line item totals. The amount distributed to each line item is relative to the amount contributed by the item to the order subtotal.

type OrderLineItemDiscountScope

type OrderLineItemDiscountScope string

OrderLineItemDiscountScope : Indicates whether this is a line-item or order-level discount.

const (
	OTHER_DISCOUNT_SCOPE_OrderLineItemDiscountScope OrderLineItemDiscountScope = "OTHER_DISCOUNT_SCOPE"
	LINE_ITEM_OrderLineItemDiscountScope            OrderLineItemDiscountScope = "LINE_ITEM"
	ORDER_OrderLineItemDiscountScope                OrderLineItemDiscountScope = "ORDER"
)

List of OrderLineItemDiscountScope

type OrderLineItemDiscountType

type OrderLineItemDiscountType string

OrderLineItemDiscountType : Indicates how the discount is applied to the associated line item or order.

const (
	UNKNOWN_DISCOUNT_OrderLineItemDiscountType    OrderLineItemDiscountType = "UNKNOWN_DISCOUNT"
	FIXED_PERCENTAGE_OrderLineItemDiscountType    OrderLineItemDiscountType = "FIXED_PERCENTAGE"
	FIXED_AMOUNT_OrderLineItemDiscountType        OrderLineItemDiscountType = "FIXED_AMOUNT"
	VARIABLE_PERCENTAGE_OrderLineItemDiscountType OrderLineItemDiscountType = "VARIABLE_PERCENTAGE"
	VARIABLE_AMOUNT_OrderLineItemDiscountType     OrderLineItemDiscountType = "VARIABLE_AMOUNT"
)

List of OrderLineItemDiscountType

type OrderLineItemItemType

type OrderLineItemItemType string

OrderLineItemItemType : Represents the line item type.

const (
	ITEM_OrderLineItemItemType          OrderLineItemItemType = "ITEM"
	CUSTOM_AMOUNT_OrderLineItemItemType OrderLineItemItemType = "CUSTOM_AMOUNT"
	GIFT_CARD_OrderLineItemItemType     OrderLineItemItemType = "GIFT_CARD"
)

List of OrderLineItemItemType

type OrderLineItemModifier

type OrderLineItemModifier struct {
	// A unique ID that identifies the modifier only within this order.
	Uid string `json:"uid,omitempty"`
	// The catalog object ID referencing [CatalogModifier](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogModifier).
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this modifier references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The name of the item modifier.
	Name string `json:"name,omitempty"`
	// The quantity of the line item modifier. The modifier quantity can be 0 or more. For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders this item, the restaurant records the purchase by creating an `Order` object with a line item for a burger. The line item includes a line item modifier: the name is cheese and the quantity is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses the extra cheese option, the modifier quantity increases to 2. If the buyer does not want any cheese, the modifier quantity is set to 0.
	Quantity string `json:"quantity,omitempty"`
	// The base price for the modifier.  `base_price_money` is required for ad hoc modifiers. If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the predefined [CatalogModifier](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogModifier) price.
	BasePriceMoney *Money `json:"base_price_money,omitempty"`
	// The total price of the item modifier for its line item. This is the modifier's `base_price_money` multiplied by the line item's quantity.
	TotalPriceMoney *Money `json:"total_price_money,omitempty"`
	// Application-defined data attached to this order. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details).  Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character.  Values have a maximum length of 255 characters.  An application can have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  For more information, see  [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
}

A [CatalogModifier](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogModifier).

type OrderLineItemPricingBlocklists

type OrderLineItemPricingBlocklists struct {
	// A list of discounts blocked from applying to the line item. Discounts can be blocked by the `discount_uid` (for ad hoc discounts) or the `discount_catalog_object_id` (for catalog discounts).
	BlockedDiscounts []OrderLineItemPricingBlocklistsBlockedDiscount `json:"blocked_discounts,omitempty"`
	// A list of taxes blocked from applying to the line item. Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or the `tax_catalog_object_id` (for catalog taxes).
	BlockedTaxes []OrderLineItemPricingBlocklistsBlockedTax `json:"blocked_taxes,omitempty"`
}

Describes pricing adjustments that are blocked from automatic application to a line item. For more information, see [Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts).

type OrderLineItemPricingBlocklistsBlockedDiscount

type OrderLineItemPricingBlocklistsBlockedDiscount struct {
	// A unique ID of the `BlockedDiscount` within the order.
	Uid string `json:"uid,omitempty"`
	// The `uid` of the discount that should be blocked. Use this field to block ad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field.
	DiscountUid string `json:"discount_uid,omitempty"`
	// The `catalog_object_id` of the discount that should be blocked. Use this field to block catalog discounts. For ad hoc discounts, use the `discount_uid` field.
	DiscountCatalogObjectId string `json:"discount_catalog_object_id,omitempty"`
}

A discount to block from applying to a line item. The discount must be identified by either `discount_uid` or `discount_catalog_object_id`, but not both.

type OrderLineItemPricingBlocklistsBlockedTax

type OrderLineItemPricingBlocklistsBlockedTax struct {
	// A unique ID of the `BlockedTax` within the order.
	Uid string `json:"uid,omitempty"`
	// The `uid` of the tax that should be blocked. Use this field to block ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field.
	TaxUid string `json:"tax_uid,omitempty"`
	// The `catalog_object_id` of the tax that should be blocked. Use this field to block catalog taxes. For ad hoc taxes, use the `tax_uid` field.
	TaxCatalogObjectId string `json:"tax_catalog_object_id,omitempty"`
}

A tax to block from applying to a line item. The tax must be identified by either `tax_uid` or `tax_catalog_object_id`, but not both.

type OrderLineItemTax

type OrderLineItemTax struct {
	// A unique ID that identifies the tax only within this order.
	Uid string `json:"uid,omitempty"`
	// The catalog object ID referencing [CatalogTax](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogTax).
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this tax references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The tax's name.
	Name string `json:"name,omitempty"`
	// Indicates the calculation method used to apply the tax.
	Type_ string `json:"type,omitempty"`
	// The percentage of the tax, as a string representation of a decimal number. For example, a value of `\"7.25\"` corresponds to a percentage of 7.25%.
	Percentage string `json:"percentage,omitempty"`
	// Application-defined data attached to this tax. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details).  Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character.  Values have a maximum length of 255 characters.  An application can have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
	// The amount of money applied by the tax in the order.
	AppliedMoney *Money `json:"applied_money,omitempty"`
	// Indicates the level at which the tax applies. For `ORDER` scoped taxes, Square generates references in `applied_taxes` on all order line items that do not have them. For `LINE_ITEM` scoped taxes, the tax only applies to line items with references in their `applied_taxes` field.  This field is immutable. To change the scope, you must delete the tax and re-add it as a new tax.
	Scope string `json:"scope,omitempty"`
	// Determines whether the tax was automatically applied to the order based on the catalog configuration. For an example, see [Automatically Apply Taxes to an Order](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes).
	AutoApplied bool `json:"auto_applied,omitempty"`
}

Represents a tax that applies to one or more line item in the order. Fixed-amount, order-scoped taxes are distributed across all non-zero line item totals. The amount distributed to each line item is relative to the amount the item contributes to the order subtotal.

type OrderLineItemTaxScope

type OrderLineItemTaxScope string

OrderLineItemTaxScope : Indicates whether this is a line-item or order-level tax.

const (
	OTHER_TAX_SCOPE_OrderLineItemTaxScope OrderLineItemTaxScope = "OTHER_TAX_SCOPE"
	LINE_ITEM_OrderLineItemTaxScope       OrderLineItemTaxScope = "LINE_ITEM"
	ORDER_OrderLineItemTaxScope           OrderLineItemTaxScope = "ORDER"
)

List of OrderLineItemTaxScope

type OrderLineItemTaxType

type OrderLineItemTaxType string

OrderLineItemTaxType : Indicates how the tax is applied to the associated line item or order.

const (
	UNKNOWN_TAX_OrderLineItemTaxType OrderLineItemTaxType = "UNKNOWN_TAX"
	ADDITIVE_OrderLineItemTaxType    OrderLineItemTaxType = "ADDITIVE"
	INCLUSIVE_OrderLineItemTaxType   OrderLineItemTaxType = "INCLUSIVE"
)

List of OrderLineItemTaxType

type OrderMoneyAmounts

type OrderMoneyAmounts struct {
	// The total money.
	TotalMoney *Money `json:"total_money,omitempty"`
	// The money associated with taxes.
	TaxMoney *Money `json:"tax_money,omitempty"`
	// The money associated with discounts.
	DiscountMoney *Money `json:"discount_money,omitempty"`
	// The money associated with tips.
	TipMoney *Money `json:"tip_money,omitempty"`
	// The money associated with service charges.
	ServiceChargeMoney *Money `json:"service_charge_money,omitempty"`
}

A collection of various money amounts.

type OrderPricingOptions

type OrderPricingOptions struct {
	// The option to determine whether pricing rule-based discounts are automatically applied to an order.
	AutoApplyDiscounts bool `json:"auto_apply_discounts,omitempty"`
	// The option to determine whether rule-based taxes are automatically applied to an order when the criteria of the corresponding rules are met.
	AutoApplyTaxes bool `json:"auto_apply_taxes,omitempty"`
}

Pricing options for an order. The options affect how the order's price is calculated. They can be used, for example, to apply automatic price adjustments that are based on preconfigured [pricing rules](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogPricingRule).

type OrderQuantityUnit

type OrderQuantityUnit struct {
	// A [MeasurementUnit](https://developer.squareup.com/reference/square_2023-12-13/objects/MeasurementUnit) that represents the unit of measure for the quantity.
	MeasurementUnit *MeasurementUnit `json:"measurement_unit,omitempty"`
	// For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity.  For example, a precision of 1 allows quantities such as `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`.  Min: 0. Max: 5.
	Precision int32 `json:"precision,omitempty"`
	// The catalog object ID referencing the [CatalogMeasurementUnit](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogMeasurementUnit).  This field is set when this is a catalog-backed measurement unit.
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this measurement unit references.  This field is set when this is a catalog-backed measurement unit.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
}

Contains the measurement unit for a quantity and a precision that specifies the number of digits after the decimal point for decimal quantities.

type OrderReturn

type OrderReturn struct {
	// A unique ID that identifies the return only within this order.
	Uid string `json:"uid,omitempty"`
	// An order that contains the original sale of these return line items. This is unset for unlinked returns.
	SourceOrderId string `json:"source_order_id,omitempty"`
	// A collection of line items that are being returned.
	ReturnLineItems []OrderReturnLineItem `json:"return_line_items,omitempty"`
	// A collection of service charges that are being returned.
	ReturnServiceCharges []OrderReturnServiceCharge `json:"return_service_charges,omitempty"`
	// A collection of references to taxes being returned for an order, including the total applied tax amount to be returned. The taxes must reference a top-level tax ID from the source order.
	ReturnTaxes []OrderReturnTax `json:"return_taxes,omitempty"`
	// A collection of references to discounts being returned for an order, including the total applied discount amount to be returned. The discounts must reference a top-level discount ID from the source order.
	ReturnDiscounts []OrderReturnDiscount `json:"return_discounts,omitempty"`
	// A positive or negative rounding adjustment to the total value being returned. Adjustments are commonly used to apply cash rounding when the minimum unit of the account is smaller than the lowest physical denomination of the currency.
	RoundingAdjustment *OrderRoundingAdjustment `json:"rounding_adjustment,omitempty"`
	// An aggregate monetary value being returned by this return entry.
	ReturnAmounts *OrderMoneyAmounts `json:"return_amounts,omitempty"`
}

The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order.

type OrderReturnDiscount

type OrderReturnDiscount struct {
	// A unique ID that identifies the returned discount only within this order.
	Uid string `json:"uid,omitempty"`
	// The discount `uid` from the order that contains the original application of this discount.
	SourceDiscountUid string `json:"source_discount_uid,omitempty"`
	// The catalog object ID referencing [CatalogDiscount](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogDiscount).
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this discount references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The discount's name.
	Name string `json:"name,omitempty"`
	// The type of the discount. If it is created by the API, it is `FIXED_PERCENTAGE` or `FIXED_AMOUNT`.  Discounts that do not reference a catalog object ID must have a type of `FIXED_PERCENTAGE` or `FIXED_AMOUNT`.
	Type_ string `json:"type,omitempty"`
	// The percentage of the tax, as a string representation of a decimal number. A value of `\"7.25\"` corresponds to a percentage of 7.25%.  `percentage` is not set for amount-based discounts.
	Percentage string `json:"percentage,omitempty"`
	// The total declared monetary amount of the discount.  `amount_money` is not set for percentage-based discounts.
	AmountMoney *Money `json:"amount_money,omitempty"`
	// The amount of discount actually applied to this line item. When an amount-based discount is at the order level, this value is different from `amount_money` because the discount is distributed across the line items.
	AppliedMoney *Money `json:"applied_money,omitempty"`
	// Indicates the level at which the `OrderReturnDiscount` applies. For `ORDER` scoped discounts, the server generates references in `applied_discounts` on all `OrderReturnLineItem`s. For `LINE_ITEM` scoped discounts, the discount is only applied to `OrderReturnLineItem`s with references in their `applied_discounts` field.
	Scope string `json:"scope,omitempty"`
}

Represents a discount being returned that applies to one or more return line items in an order. Fixed-amount, order-scoped discounts are distributed across all non-zero return line item totals. The amount distributed to each return line item is relative to that item’s contribution to the order subtotal.

type OrderReturnLineItem

type OrderReturnLineItem struct {
	// A unique ID for this return line-item entry.
	Uid string `json:"uid,omitempty"`
	// The `uid` of the line item in the original sale order.
	SourceLineItemUid string `json:"source_line_item_uid,omitempty"`
	// The name of the line item.
	Name string `json:"name,omitempty"`
	// The quantity returned, formatted as a decimal number. For example, `\"3\"`.  Line items with a `quantity_unit` can have non-integer quantities. For example, `\"1.70000\"`.
	Quantity string `json:"quantity"`
	// The unit and precision that this return line item's quantity is measured in.
	QuantityUnit *OrderQuantityUnit `json:"quantity_unit,omitempty"`
	// The note of the return line item.
	Note string `json:"note,omitempty"`
	// The [CatalogItemVariation](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogItemVariation) ID applied to this return line item.
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this line item references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The name of the variation applied to this return line item.
	VariationName string `json:"variation_name,omitempty"`
	// The type of line item: an itemized return, a non-itemized return (custom amount), or the return of an unactivated gift card sale.
	ItemType string `json:"item_type,omitempty"`
	// The [CatalogModifier](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogModifier)s applied to this line item.
	ReturnModifiers []OrderReturnLineItemModifier `json:"return_modifiers,omitempty"`
	// The list of references to `OrderReturnTax` entities applied to the return line item. Each `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level `OrderReturnTax` applied to the return line item. On reads, the applied amount is populated.
	AppliedTaxes []OrderLineItemAppliedTax `json:"applied_taxes,omitempty"`
	// The list of references to `OrderReturnDiscount` entities applied to the return line item. Each `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level `OrderReturnDiscount` applied to the return line item. On reads, the applied amount is populated.
	AppliedDiscounts []OrderLineItemAppliedDiscount `json:"applied_discounts,omitempty"`
	// The base price for a single unit of the line item.
	BasePriceMoney *Money `json:"base_price_money,omitempty"`
	// The total price of all item variations returned in this line item. The price is calculated as `base_price_money` multiplied by `quantity` and does not include modifiers.
	VariationTotalPriceMoney *Money `json:"variation_total_price_money,omitempty"`
	// The gross return amount of money calculated as (item base price + modifiers price) * quantity.
	GrossReturnMoney *Money `json:"gross_return_money,omitempty"`
	// The total amount of tax money to return for the line item.
	TotalTaxMoney *Money `json:"total_tax_money,omitempty"`
	// The total amount of discount money to return for the line item.
	TotalDiscountMoney *Money `json:"total_discount_money,omitempty"`
	// The total amount of money to return for this line item.
	TotalMoney *Money `json:"total_money,omitempty"`
	// The list of references to `OrderReturnServiceCharge` entities applied to the return line item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_uid` that references the `uid` of a top-level `OrderReturnServiceCharge` applied to the return line item. On reads, the applied amount is populated.
	AppliedServiceCharges []OrderLineItemAppliedServiceCharge `json:"applied_service_charges,omitempty"`
	// The total amount of apportioned service charge money to return for the line item.
	TotalServiceChargeMoney *Money `json:"total_service_charge_money,omitempty"`
}

The line item being returned in an order.

type OrderReturnLineItemModifier

type OrderReturnLineItemModifier struct {
	// A unique ID that identifies the return modifier only within this order.
	Uid string `json:"uid,omitempty"`
	// The modifier `uid` from the order's line item that contains the original sale of this line item modifier.
	SourceModifierUid string `json:"source_modifier_uid,omitempty"`
	// The catalog object ID referencing [CatalogModifier](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogModifier).
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this line item modifier references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The name of the item modifier.
	Name string `json:"name,omitempty"`
	// The base price for the modifier.  `base_price_money` is required for ad hoc modifiers. If both `catalog_object_id` and `base_price_money` are set, `base_price_money` overrides the predefined [CatalogModifier](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogModifier) price.
	BasePriceMoney *Money `json:"base_price_money,omitempty"`
	// The total price of the item modifier for its line item. This is the modifier's `base_price_money` multiplied by the line item's quantity.
	TotalPriceMoney *Money `json:"total_price_money,omitempty"`
	// The quantity of the line item modifier. The modifier quantity can be 0 or more. For example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders this item, the restaurant records the purchase by creating an `Order` object with a line item for a burger. The line item includes a line item modifier: the name is cheese and the quantity is 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses the extra cheese option, the modifier quantity increases to 2. If the buyer does not want any cheese, the modifier quantity is set to 0.
	Quantity string `json:"quantity,omitempty"`
}

A line item modifier being returned.

type OrderReturnServiceCharge

type OrderReturnServiceCharge struct {
	// A unique ID that identifies the return service charge only within this order.
	Uid string `json:"uid,omitempty"`
	// The service charge `uid` from the order containing the original service charge. `source_service_charge_uid` is `null` for unlinked returns.
	SourceServiceChargeUid string `json:"source_service_charge_uid,omitempty"`
	// The name of the service charge.
	Name string `json:"name,omitempty"`
	// The catalog object ID of the associated [OrderServiceCharge](https://developer.squareup.com/reference/square_2023-12-13/objects/OrderServiceCharge).
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this service charge references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The percentage of the service charge, as a string representation of a decimal number. For example, a value of `\"7.25\"` corresponds to a percentage of 7.25%.  Either `percentage` or `amount_money` should be set, but not both.
	Percentage string `json:"percentage,omitempty"`
	// The amount of a non-percentage-based service charge.  Either `percentage` or `amount_money` should be set, but not both.
	AmountMoney *Money `json:"amount_money,omitempty"`
	// The amount of money applied to the order by the service charge, including any inclusive tax amounts, as calculated by Square.  - For fixed-amount service charges, `applied_money` is equal to `amount_money`. - For percentage-based service charges, `applied_money` is the money calculated using the percentage.
	AppliedMoney *Money `json:"applied_money,omitempty"`
	// The total amount of money to collect for the service charge.  __NOTE__: If an inclusive tax is applied to the service charge, `total_money` does not equal `applied_money` plus `total_tax_money` because the inclusive tax amount is already included in both `applied_money` and `total_tax_money`.
	TotalMoney *Money `json:"total_money,omitempty"`
	// The total amount of tax money to collect for the service charge.
	TotalTaxMoney *Money `json:"total_tax_money,omitempty"`
	// The calculation phase after which to apply the service charge.
	CalculationPhase string `json:"calculation_phase,omitempty"`
	// Indicates whether the surcharge can be taxed. Service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable.
	Taxable bool `json:"taxable,omitempty"`
	// The list of references to `OrderReturnTax` entities applied to the `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level `OrderReturnTax` that is being applied to the `OrderReturnServiceCharge`. On reads, the applied amount is populated.
	AppliedTaxes []OrderLineItemAppliedTax `json:"applied_taxes,omitempty"`
	// The treatment type of the service charge.
	TreatmentType string `json:"treatment_type,omitempty"`
	// Indicates the level at which the apportioned service charge applies. For `ORDER` scoped service charges, Square generates references in `applied_service_charges` on all order line items that do not have them. For `LINE_ITEM` scoped service charges, the service charge only applies to line items with a service charge reference in their `applied_service_charges` field.  This field is immutable. To change the scope of an apportioned service charge, you must delete the apportioned service charge and re-add it as a new apportioned service charge.
	Scope string `json:"scope,omitempty"`
}

Represents the service charge applied to the original order.

type OrderReturnTax

type OrderReturnTax struct {
	// A unique ID that identifies the returned tax only within this order.
	Uid string `json:"uid,omitempty"`
	// The tax `uid` from the order that contains the original tax charge.
	SourceTaxUid string `json:"source_tax_uid,omitempty"`
	// The catalog object ID referencing [CatalogTax](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogTax).
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this tax references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The tax's name.
	Name string `json:"name,omitempty"`
	// Indicates the calculation method used to apply the tax.
	Type_ string `json:"type,omitempty"`
	// The percentage of the tax, as a string representation of a decimal number. For example, a value of `\"7.25\"` corresponds to a percentage of 7.25%.
	Percentage string `json:"percentage,omitempty"`
	// The amount of money applied by the tax in an order.
	AppliedMoney *Money `json:"applied_money,omitempty"`
	// Indicates the level at which the `OrderReturnTax` applies. For `ORDER` scoped taxes, Square generates references in `applied_taxes` on all `OrderReturnLineItem`s. For `LINE_ITEM` scoped taxes, the tax is only applied to `OrderReturnLineItem`s with references in their `applied_discounts` field.
	Scope string `json:"scope,omitempty"`
}

Represents a tax being returned that applies to one or more return line items in an order. Fixed-amount, order-scoped taxes are distributed across all non-zero return line item totals. The amount distributed to each return line item is relative to that item’s contribution to the order subtotal.

type OrderReward

type OrderReward struct {
	// The identifier of the reward.
	Id string `json:"id"`
	// The identifier of the reward tier corresponding to this reward.
	RewardTierId string `json:"reward_tier_id"`
}

Represents a reward that can be applied to an order if the necessary reward tier criteria are met. Rewards are created through the Loyalty API.

type OrderRoundingAdjustment

type OrderRoundingAdjustment struct {
	// A unique ID that identifies the rounding adjustment only within this order.
	Uid string `json:"uid,omitempty"`
	// The name of the rounding adjustment from the original sale order.
	Name string `json:"name,omitempty"`
	// The actual rounding adjustment amount.
	AmountMoney *Money `json:"amount_money,omitempty"`
}

A rounding adjustment of the money being returned. Commonly used to apply cash rounding when the minimum unit of the account is smaller than the lowest physical denomination of the currency.

type OrderServiceCharge

type OrderServiceCharge struct {
	// A unique ID that identifies the service charge only within this order.
	Uid string `json:"uid,omitempty"`
	// The name of the service charge.
	Name string `json:"name,omitempty"`
	// The catalog object ID referencing the service charge [CatalogObject](https://developer.squareup.com/reference/square_2023-12-13/objects/CatalogObject).
	CatalogObjectId string `json:"catalog_object_id,omitempty"`
	// The version of the catalog object that this service charge references.
	CatalogVersion int64 `json:"catalog_version,omitempty"`
	// The service charge percentage as a string representation of a decimal number. For example, `\"7.25\"` indicates a service charge of 7.25%.  Exactly 1 of `percentage` or `amount_money` should be set.
	Percentage string `json:"percentage,omitempty"`
	// The amount of a non-percentage-based service charge.  Exactly one of `percentage` or `amount_money` should be set.
	AmountMoney *Money `json:"amount_money,omitempty"`
	// The amount of money applied to the order by the service charge, including any inclusive tax amounts, as calculated by Square.  - For fixed-amount service charges, `applied_money` is equal to `amount_money`. - For percentage-based service charges, `applied_money` is the money calculated using the percentage.
	AppliedMoney *Money `json:"applied_money,omitempty"`
	// The total amount of money to collect for the service charge.  __Note__: If an inclusive tax is applied to the service charge, `total_money` does not equal `applied_money` plus `total_tax_money` because the inclusive tax amount is already included in both `applied_money` and `total_tax_money`.
	TotalMoney *Money `json:"total_money,omitempty"`
	// The total amount of tax money to collect for the service charge.
	TotalTaxMoney *Money `json:"total_tax_money,omitempty"`
	// The calculation phase at which to apply the service charge.
	CalculationPhase string `json:"calculation_phase,omitempty"`
	// Indicates whether the service charge can be taxed. If set to `true`, order-level taxes automatically apply to the service charge. Note that service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable.
	Taxable bool `json:"taxable,omitempty"`
	// The list of references to the taxes applied to this service charge. Each `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level `OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied is populated.  An `OrderLineItemAppliedTax` is automatically created on every taxable service charge for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable service charge. Taxable service charges have the `taxable` field set to `true` and calculated in the `SUBTOTAL_PHASE`.  To change the amount of a tax, modify the referenced top-level tax.
	AppliedTaxes []OrderLineItemAppliedTax `json:"applied_taxes,omitempty"`
	// Application-defined data attached to this service charge. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (such as personally identifiable information or card details).  Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character.  Values have a maximum length of 255 characters.  An application can have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).
	Metadata map[string]string `json:"metadata,omitempty"`
	// The type of the service charge.
	Type_ string `json:"type,omitempty"`
	// The treatment type of the service charge.
	TreatmentType string `json:"treatment_type,omitempty"`
	// Indicates the level at which the apportioned service charge applies. For `ORDER` scoped service charges, Square generates references in `applied_service_charges` on all order line items that do not have them. For `LINE_ITEM` scoped service charges, the service charge only applies to line items with a service charge reference in their `applied_service_charges` field.  This field is immutable. To change the scope of an apportioned service charge, you must delete the apportioned service charge and re-add it as a new apportioned service charge.
	Scope string `json:"scope,omitempty"`
}

Represents a service charge applied to an order.

type OrderServiceChargeCalculationPhase

type OrderServiceChargeCalculationPhase string

OrderServiceChargeCalculationPhase : Represents a phase in the process of calculating order totals. Service charges are applied after the indicated phase. [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated)

const (
	SUBTOTAL_PHASE_OrderServiceChargeCalculationPhase               OrderServiceChargeCalculationPhase = "SUBTOTAL_PHASE"
	TOTAL_PHASE_OrderServiceChargeCalculationPhase                  OrderServiceChargeCalculationPhase = "TOTAL_PHASE"
	APPORTIONED_PERCENTAGE_PHASE_OrderServiceChargeCalculationPhase OrderServiceChargeCalculationPhase = "APPORTIONED_PERCENTAGE_PHASE"
	APPORTIONED_AMOUNT_PHASE_OrderServiceChargeCalculationPhase     OrderServiceChargeCalculationPhase = "APPORTIONED_AMOUNT_PHASE"
)

List of OrderServiceChargeCalculationPhase

type OrderServiceChargeScope

type OrderServiceChargeScope string

OrderServiceChargeScope : Indicates whether this is a line-item or order-level apportioned service charge.

const (
	OTHER_SERVICE_CHARGE_SCOPE_OrderServiceChargeScope OrderServiceChargeScope = "OTHER_SERVICE_CHARGE_SCOPE"
	LINE_ITEM_OrderServiceChargeScope                  OrderServiceChargeScope = "LINE_ITEM"
	ORDER_OrderServiceChargeScope                      OrderServiceChargeScope = "ORDER"
)

List of OrderServiceChargeScope

type OrderServiceChargeTreatmentType

type OrderServiceChargeTreatmentType string

OrderServiceChargeTreatmentType : Indicates whether the service charge will be treated as a value-holding line item or apportioned toward a line item.

const (
	LINE_ITEM_TREATMENT_OrderServiceChargeTreatmentType   OrderServiceChargeTreatmentType = "LINE_ITEM_TREATMENT"
	APPORTIONED_TREATMENT_OrderServiceChargeTreatmentType OrderServiceChargeTreatmentType = "APPORTIONED_TREATMENT"
)

List of OrderServiceChargeTreatmentType

type OrderServiceChargeType

type OrderServiceChargeType string

OrderServiceChargeType :

const (
	AUTO_GRATUITY_OrderServiceChargeType OrderServiceChargeType = "AUTO_GRATUITY"
	CUSTOM_OrderServiceChargeType        OrderServiceChargeType = "CUSTOM"
)

List of OrderServiceChargeType

type OrderSource

type OrderSource struct {
	// The name used to identify the place (physical or digital) that an order originates. If unset, the name defaults to the name of the application that created the order.
	Name string `json:"name,omitempty"`
}

Represents the origination details of an order.

type OrderState

type OrderState string

OrderState : The state of the order.

const (
	OPEN_OrderState      OrderState = "OPEN"
	COMPLETED_OrderState OrderState = "COMPLETED"
	CANCELED_OrderState  OrderState = "CANCELED"
	DRAFT_OrderState     OrderState = "DRAFT"
)

List of OrderState

type OrderUpdated

type OrderUpdated struct {
	// The order's unique ID.
	OrderId string `json:"order_id,omitempty"`
	// The version number, which is incremented each time an update is committed to the order. Orders that were not created through the API do not include a version number and therefore cannot be updated.  [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)
	Version int32 `json:"version,omitempty"`
	// The ID of the seller location that this order is associated with.
	LocationId string `json:"location_id,omitempty"`
	// The state of the order.
	State string `json:"state,omitempty"`
	// The timestamp for when the order was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The timestamp for when the order was last updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
}

type OrderUpdatedObject

type OrderUpdatedObject struct {
	// Information about the updated order.
	OrderUpdated *OrderUpdated `json:"order_updated,omitempty"`
}

type PayOrderRequest

type PayOrderRequest struct {
	// A value you specify that uniquely identifies this request among requests you have sent. If you are unsure whether a particular payment request was completed successfully, you can reattempt it with the same idempotency key without worrying about duplicate payments.  For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
	IdempotencyKey string `json:"idempotency_key"`
	// The version of the order being paid. If not supplied, the latest version will be paid.
	OrderVersion int32 `json:"order_version,omitempty"`
	// The IDs of the [payments](https://developer.squareup.com/reference/square_2023-12-13/objects/Payment) to collect. The payment total must match the order total.
	PaymentIds []string `json:"payment_ids,omitempty"`
}

Defines the fields that are included in requests to the [PayOrder](https://developer.squareup.com/reference/square_2023-12-13/orders-api/pay-order) endpoint.

type PayOrderResponse

type PayOrderResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The paid, updated [order](https://developer.squareup.com/reference/square_2023-12-13/objects/Order).
	Order *Order `json:"order,omitempty"`
}

Defines the fields that are included in the response body of a request to the [PayOrder](https://developer.squareup.com/reference/square_2023-12-13/orders-api/pay-order) endpoint.

type Payment

type Payment struct {
	// A unique ID for the payment.
	Id string `json:"id,omitempty"`
	// The timestamp of when the payment was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The timestamp of when the payment was last updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
	// The amount processed for this payment, not including `tip_money`.  The amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).
	AmountMoney *Money `json:"amount_money,omitempty"`
	// The amount designated as a tip.   This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).
	TipMoney *Money `json:"tip_money,omitempty"`
	// The total amount for the payment, including `amount_money` and `tip_money`. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).
	TotalMoney *Money `json:"total_money,omitempty"`
	// The amount the developer is taking as a fee for facilitating the payment on behalf of the seller. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).  The amount cannot be more than 90% of the `total_money` value.  To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).
	AppFeeMoney *Money `json:"app_fee_money,omitempty"`
	// The initial amount of money approved for this payment.
	ApprovedMoney *Money `json:"approved_money,omitempty"`
	// The processing fees and fee adjustments assessed by Square for this payment.
	ProcessingFee []ProcessingFee `json:"processing_fee,omitempty"`
	// The total amount of the payment refunded to date.   This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents).
	RefundedMoney *Money `json:"refunded_money,omitempty"`
	// Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED.
	Status string `json:"status,omitempty"`
	// The duration of time after the payment's creation when Square automatically applies the `delay_action` to the payment. This automatic `delay_action` applies only to payments that do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration` time period.  This field is specified as a time duration, in RFC 3339 format.  Notes: This feature is only supported for card payments.  Default:  - Card-present payments: \"PT36H\" (36 hours) from the creation time. - Card-not-present payments: \"P7D\" (7 days) from the creation time.
	DelayDuration string `json:"delay_duration,omitempty"`
	// The action to be applied to the payment when the `delay_duration` has elapsed.  Current values include `CANCEL` and `COMPLETE`.
	DelayAction string `json:"delay_action,omitempty"`
	// The read-only timestamp of when the `delay_action` is automatically applied, in RFC 3339 format.  Note that this field is calculated by summing the payment's `delay_duration` and `created_at` fields. The `created_at` field is generated by Square and might not exactly match the time on your local machine.
	DelayedUntil string `json:"delayed_until,omitempty"`
	// The source type for this payment.  Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`, `CASH` and `EXTERNAL`. For information about these payment source types, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).
	SourceType string `json:"source_type,omitempty"`
	// The ID of the location associated with the payment.
	LocationId string `json:"location_id,omitempty"`
	// The ID of the order associated with the payment.
	OrderId string `json:"order_id,omitempty"`
	// An optional ID that associates the payment with an entity in another system.
	ReferenceId string `json:"reference_id,omitempty"`
	// The ID of the customer associated with the payment. If the ID is  not provided in the `CreatePayment` request that was used to create the `Payment`,  Square may use information in the request  (such as the billing and shipping address, email address, and payment source)  to identify a matching customer profile in the Customer Directory.  If found, the profile ID is used. If a profile is not found, the  API attempts to create an  [instant profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles).  If the API cannot create an  instant profile (either because the seller has disabled it or the  seller's region prevents creating it), this field remains unset. Note that  this process is asynchronous and it may take some time before a  customer ID is added to the payment.
	CustomerId string `json:"customer_id,omitempty"`
	// __Deprecated__: Use `Payment.team_member_id` instead.  An optional ID of the employee associated with taking the payment.
	EmployeeId string `json:"employee_id,omitempty"`
	// An optional ID of the [TeamMember](https://developer.squareup.com/reference/square_2023-12-13/objects/TeamMember) associated with taking the payment.
	TeamMemberId string `json:"team_member_id,omitempty"`
	// A list of `refund_id`s identifying refunds for the payment.
	RefundIds []string `json:"refund_ids,omitempty"`
	// The buyer's email address.
	BuyerEmailAddress string `json:"buyer_email_address,omitempty"`
	// The buyer's billing address.
	BillingAddress *Address `json:"billing_address,omitempty"`
	// The buyer's shipping address.
	ShippingAddress *Address `json:"shipping_address,omitempty"`
	// An optional note to include when creating a payment.
	Note string `json:"note,omitempty"`
	// Additional payment information that gets added to the customer's card statement as part of the statement description.  Note that the `statement_description_identifier` might get truncated on the statement description to fit the required information including the Square identifier (SQ *) and the name of the seller taking the payment.
	StatementDescriptionIdentifier string `json:"statement_description_identifier,omitempty"`
	// Actions that can be performed on this payment: - `EDIT_AMOUNT_UP` - The payment amount can be edited up. - `EDIT_AMOUNT_DOWN` - The payment amount can be edited down. - `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up. - `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down. - `EDIT_DELAY_ACTION` - The delay_action can be edited.
	Capabilities []string `json:"capabilities,omitempty"`
	// The payment's receipt number. The field is missing if a payment is canceled.
	ReceiptNumber string `json:"receipt_number,omitempty"`
	// The URL for the payment's receipt. The field is only populated for COMPLETED payments.
	ReceiptUrl string `json:"receipt_url,omitempty"`
	// Details about the device that took the payment.
	DeviceDetails *DeviceDetails `json:"device_details,omitempty"`
	// Details about the application that took the payment.
	ApplicationDetails *ApplicationDetails `json:"application_details,omitempty"`
	// Used for optimistic concurrency. This opaque token identifies a specific version of the `Payment` object.
	VersionToken string `json:"version_token,omitempty"`
}

Represents a payment processed by the Square API.

type PaymentRefund

type PaymentRefund struct {
	// The unique ID for this refund, generated by Square.
	Id string `json:"id"`
	// The refund's status: - `PENDING` - Awaiting approval. - `COMPLETED` - Successfully completed. - `REJECTED` - The refund was rejected. - `FAILED` - An error occurred.
	Status string `json:"status,omitempty"`
	// The location ID associated with the payment this refund is attached to.
	LocationId string `json:"location_id,omitempty"`
	// Flag indicating whether or not the refund is linked to an existing payment in Square.
	Unlinked bool `json:"unlinked,omitempty"`
	// The destination type for this refund.  Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`, and `EXTERNAL`.
	DestinationType string `json:"destination_type,omitempty"`
	// Contains information about the refund destination. This field is populated only if `destination_id` is defined in the `RefundPayment` request.
	DestinationDetails *DestinationDetails `json:"destination_details,omitempty"`
	// The amount of money refunded. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents).
	AmountMoney *Money `json:"amount_money"`
	// The amount of money the application developer contributed to help cover the refunded amount. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).
	AppFeeMoney *Money `json:"app_fee_money,omitempty"`
	// Processing fees and fee adjustments assessed by Square for this refund.
	ProcessingFee []ProcessingFee `json:"processing_fee,omitempty"`
	// The ID of the payment associated with this refund.
	PaymentId string `json:"payment_id,omitempty"`
	// The ID of the order associated with the refund.
	OrderId string `json:"order_id,omitempty"`
	// The reason for the refund.
	Reason string `json:"reason,omitempty"`
	// The timestamp of when the refund was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The timestamp of when the refund was last updated, in RFC 3339 format.
	UpdatedAt string `json:"updated_at,omitempty"`
	// An optional ID of the team member associated with taking the payment.
	TeamMemberId string `json:"team_member_id,omitempty"`
}

Represents a refund of a payment made using Square. Contains information about the original payment and the amount of money refunded.

type ProcessingFee

type ProcessingFee struct {
	// The timestamp of when the fee takes effect, in RFC 3339 format.
	EffectiveAt string `json:"effective_at,omitempty"`
	// The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`.
	Type_ string `json:"type,omitempty"`
	// The fee amount, which might be negative, that is assessed or adjusted by Square.  Positive values represent funds being assessed, while negative values represent funds being returned.
	AmountMoney *Money `json:"amount_money,omitempty"`
}

Represents the Square processing fee.

type Refund

type Refund struct {
	// The refund's unique ID.
	Id string `json:"id"`
	// The ID of the refund's associated location.
	LocationId string `json:"location_id"`
	// The ID of the transaction that the refunded tender is part of.
	TransactionId string `json:"transaction_id,omitempty"`
	// The ID of the refunded tender.
	TenderId string `json:"tender_id"`
	// The timestamp for when the refund was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The reason for the refund being issued.
	Reason string `json:"reason"`
	// The amount of money refunded to the buyer.
	AmountMoney *Money `json:"amount_money"`
	// The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, or `FAILED`).
	Status string `json:"status"`
	// The amount of Square processing fee money refunded to the *merchant*.
	ProcessingFeeMoney *Money `json:"processing_fee_money,omitempty"`
	// Additional recipients (other than the merchant) receiving a portion of this refund. For example, fees assessed on a refund of a purchase by a third party integration.
	AdditionalRecipients []AdditionalRecipient `json:"additional_recipients,omitempty"`
}

Represents a refund processed for a Square transaction.

type RefundPaymentRequest

type RefundPaymentRequest struct {
	//  A unique string that identifies this `RefundPayment` request. The key can be any valid string but must be unique for every `RefundPayment` request.  Keys are limited to a max of 45 characters - however, the number of allowed characters might be less than 45, if multi-byte characters are used.  For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
	IdempotencyKey string `json:"idempotency_key"`
	// The amount of money to refund.  This amount cannot be more than the `total_money` value of the payment minus the total amount of all previously completed refunds for this payment.  This amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).  The currency code must match the currency associated with the business that is charging the card.
	AmountMoney *Money `json:"amount_money"`
	// The amount of money the developer contributes to help cover the refunded amount. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents).  The value cannot be more than the `amount_money`.  You can specify this parameter in a refund request only if the same parameter was also included when taking the payment. This is part of the application fee scenario the API supports. For more information, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).  To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).
	AppFeeMoney *Money `json:"app_fee_money,omitempty"`
	// The unique ID of the payment being refunded. Required when unlinked=false, otherwise must not be set.
	PaymentId string `json:"payment_id,omitempty"`
	// The ID indicating where funds will be refunded to, if this is an unlinked refund. This can be any of the following: A token generated by Web Payments SDK; a card-on-file identifier. Required for requests specifying unlinked=true. Otherwise, if included when `unlinked=false`, will throw an error.
	DestinationId string `json:"destination_id,omitempty"`
	// Indicates that the refund is not linked to a Square payment. If set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not be provided.
	Unlinked bool `json:"unlinked,omitempty"`
	// The location ID associated with the unlinked refund. Required for requests specifying `unlinked=true`. Otherwise, if included when `unlinked=false`, will throw an error.
	LocationId string `json:"location_id,omitempty"`
	// The [Customer](https://developer.squareup.com/reference/square_2023-12-13/objects/Customer) ID of the customer associated with the refund. This is required if the `destination_id` refers to a card on file created using the Cards API. Only allowed when `unlinked=true`.
	CustomerId string `json:"customer_id,omitempty"`
	// A description of the reason for the refund.
	Reason string `json:"reason,omitempty"`
	//  Used for optimistic concurrency. This opaque token identifies the current `Payment` version that the caller expects. If the server has a different version of the Payment, the update fails and a response with a VERSION_MISMATCH error is returned. If the versions match, or the field is not provided, the refund proceeds as normal.
	PaymentVersionToken string `json:"payment_version_token,omitempty"`
	// An optional [TeamMember](https://developer.squareup.com/reference/square_2023-12-13/objects/TeamMember) ID to associate with this refund.
	TeamMemberId string `json:"team_member_id,omitempty"`
}

Describes a request to refund a payment using [RefundPayment](https://developer.squareup.com/reference/square_2023-12-13/refunds-api/refund-payment).

type RefundPaymentResponse

type RefundPaymentResponse struct {
	// Information about errors encountered during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The successfully created `PaymentRefund`.
	Refund *PaymentRefund `json:"refund,omitempty"`
}

Defines the response returned by [RefundPayment](https://developer.squareup.com/reference/square_2023-12-13/refunds-api/refund-payment). If there are errors processing the request, the `refund` field might not be present, or it might be present with a status of `FAILED`.

type RefundStatus

type RefundStatus string

RefundStatus : Indicates a refund's current status.

const (
	PENDING_RefundStatus  RefundStatus = "PENDING"
	APPROVED_RefundStatus RefundStatus = "APPROVED"
	REJECTED_RefundStatus RefundStatus = "REJECTED"
	FAILED_RefundStatus   RefundStatus = "FAILED"
)

List of RefundStatus

type RemoveGroupFromCustomerRequest

type RemoveGroupFromCustomerRequest struct {
}

Defines the fields that are included in the request body of a request to the [RemoveGroupFromCustomer](https://developer.squareup.com/reference/square_2023-12-13/customers-api/remove-group-from-customer) endpoint.

type RemoveGroupFromCustomerResponse

type RemoveGroupFromCustomerResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the [RemoveGroupFromCustomer](https://developer.squareup.com/reference/square_2023-12-13/customers-api/remove-group-from-customer) endpoint.

type RetrieveCustomerRequest

type RetrieveCustomerRequest struct {
}

Defines the fields that are included in requests to the `RetrieveCustomer` endpoint.

type RetrieveCustomerResponse

type RetrieveCustomerResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The requested customer.
	Customer *Customer `json:"customer,omitempty"`
}

Defines the fields that are included in the response body of a request to the `RetrieveCustomer` endpoint. Either `errors` or `customer` is present in a given response (never both).

type RetrieveOrderCustomAttributeDefinitionRequest

type RetrieveOrderCustomAttributeDefinitionRequest struct {
	// To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control, include this optional field and specify the current version of the custom attribute.
	Version int32 `json:"version,omitempty"`
}

Represents a get request for an order custom attribute definition.

type RetrieveOrderCustomAttributeDefinitionResponse

type RetrieveOrderCustomAttributeDefinitionResponse struct {
	// The retrieved custom attribute definition.
	CustomAttributeDefinition *CustomAttributeDefinition `json:"custom_attribute_definition,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from getting an order custom attribute definition.

type RetrieveOrderCustomAttributeRequest

type RetrieveOrderCustomAttributeRequest struct {
	// To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control, include this optional field and specify the current version of the custom attribute.
	Version int32 `json:"version,omitempty"`
	// Indicates whether to return the [custom attribute definition](https://developer.squareup.com/reference/square_2023-12-13/objects/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`.
	WithDefinition bool `json:"with_definition,omitempty"`
}

Represents a get request for an order custom attribute.

type RetrieveOrderCustomAttributeResponse

type RetrieveOrderCustomAttributeResponse struct {
	// The retrieved custom attribute. If `with_definition` was set to `true` in the request, the custom attribute definition is returned in the `definition field.
	CustomAttribute *CustomAttribute `json:"custom_attribute,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from getting an order custom attribute.

type RetrieveOrderRequest

type RetrieveOrderRequest struct {
}

type RetrieveOrderResponse

type RetrieveOrderResponse struct {
	// The requested order.
	Order *Order `json:"order,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

type RetrieveTransactionRequest

type RetrieveTransactionRequest struct {
}

type RetrieveTransactionResponse

type RetrieveTransactionResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The requested transaction.
	Transaction *Transaction `json:"transaction,omitempty"`
}

Defines the fields that are included in the response body of a request to the [RetrieveTransaction](https://developer.squareup.com/reference/square_2023-12-13/transactions-api/retrieve-transaction) endpoint. One of `errors` or `transaction` is present in a given response (never both).

type SearchCustomersRequest

type SearchCustomersRequest struct {
	// Include the pagination cursor in subsequent calls to this endpoint to retrieve the next set of results associated with the original query.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor string `json:"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 invalid, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Limit int64 `json:"limit,omitempty"`
	// The filtering and sorting criteria for the search request. If a query is not specified, Square returns all customer profiles ordered alphabetically by `given_name` and `family_name`.
	Query *CustomerQuery `json:"query,omitempty"`
	// Indicates whether to return the total count of matching customers in the `count` field of the response.  The default value is `false`.
	Count bool `json:"count,omitempty"`
}

Defines the fields that are included in the request body of a request to the `SearchCustomers` endpoint.

type SearchCustomersResponse

type SearchCustomersResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The customer profiles that match the search query. If any search condition is not met, the result is an empty object (`{}`). Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are included in the response.
	Customers []Customer `json:"customers,omitempty"`
	// A pagination cursor that can be used during subsequent calls to `SearchCustomers` to retrieve the next set of results associated with the original query. Pagination cursors are only present when a request succeeds and additional results are available.  For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor string `json:"cursor,omitempty"`
	// The total count of customers associated with the Square account that match the search query. Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is present only if `count` is set to `true` in the request.
	Count int64 `json:"count,omitempty"`
}

Defines the fields that are included in the response body of a request to the `SearchCustomers` endpoint. Either `errors` or `customers` is present in a given response (never both).

type SearchOrdersCustomerFilter

type SearchOrdersCustomerFilter struct {
	// A list of customer IDs to filter by.  Max: 10 customer IDs.
	CustomerIds []string `json:"customer_ids,omitempty"`
}

A filter based on the order `customer_id` and any tender `customer_id` associated with the order. It does not filter based on the FulfillmentRecipient(https://developer.squareup.com/reference/square_2023-12-13/objects/FulfillmentRecipient) `customer_id`.

type SearchOrdersDateTimeFilter

type SearchOrdersDateTimeFilter struct {
	// The time range for filtering on the `created_at` timestamp. If you use this value, you must set the `sort_field` in the `OrdersSearchSort` object to `CREATED_AT`.
	CreatedAt *TimeRange `json:"created_at,omitempty"`
	// The time range for filtering on the `updated_at` timestamp. If you use this value, you must set the `sort_field` in the `OrdersSearchSort` object to `UPDATED_AT`.
	UpdatedAt *TimeRange `json:"updated_at,omitempty"`
	// The time range for filtering on the `closed_at` timestamp. If you use this value, you must set the `sort_field` in the `OrdersSearchSort` object to `CLOSED_AT`.
	ClosedAt *TimeRange `json:"closed_at,omitempty"`
}

Filter for `Order` objects based on whether their `CREATED_AT`, `CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time range. You can specify the time range and which timestamp to filter for. You can filter for only one time range at a time. For each time range, the start time and end time are inclusive. If the end time is absent, it defaults to the time of the first request for the cursor. __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, you must set the `sort_field` in [OrdersSort](https://developer.squareup.com/reference/square_2023-12-13/objects/SearchOrdersSort) to the same field you filter for. For example, if you set the `CLOSED_AT` field in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to `CLOSED_AT`. Otherwise, `SearchOrders` throws an error. [Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range)

type SearchOrdersFilter

type SearchOrdersFilter struct {
	// Filter by [OrderState](https://developer.squareup.com/reference/square_2023-12-13/enums/OrderState).
	StateFilter *SearchOrdersStateFilter `json:"state_filter,omitempty"`
	// Filter for results within a time range.  __Important:__ If you filter for orders by time range, you must set `SearchOrdersSort` to sort by the same field. [Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range)
	DateTimeFilter *SearchOrdersDateTimeFilter `json:"date_time_filter,omitempty"`
	// Filter by the fulfillment type or state.
	FulfillmentFilter *SearchOrdersFulfillmentFilter `json:"fulfillment_filter,omitempty"`
	// Filter by the source of the order.
	SourceFilter *SearchOrdersSourceFilter `json:"source_filter,omitempty"`
	// Filter by customers associated with the order.
	CustomerFilter *SearchOrdersCustomerFilter `json:"customer_filter,omitempty"`
}

Filtering criteria to use for a `SearchOrders` request. Multiple filters are ANDed together.

type SearchOrdersFulfillmentFilter

type SearchOrdersFulfillmentFilter struct {
	// A list of [fulfillment types](https://developer.squareup.com/reference/square_2023-12-13/enums/FulfillmentType) to filter for. The list returns orders if any of its fulfillments match any of the fulfillment types listed in this field.
	FulfillmentTypes []string `json:"fulfillment_types,omitempty"`
	// A list of [fulfillment states](https://developer.squareup.com/reference/square_2023-12-13/enums/FulfillmentState) to filter for. The list returns orders if any of its fulfillments match any of the fulfillment states listed in this field.
	FulfillmentStates []string `json:"fulfillment_states,omitempty"`
}

Filter based on [order fulfillment](https://developer.squareup.com/reference/square_2023-12-13/objects/Fulfillment) information.

type SearchOrdersQuery

type SearchOrdersQuery struct {
	// Criteria to filter results by.
	Filter *SearchOrdersFilter `json:"filter,omitempty"`
	// Criteria to sort results by.
	Sort *SearchOrdersSort `json:"sort,omitempty"`
}

Contains query criteria for the search.

type SearchOrdersRequest

type SearchOrdersRequest struct {
	// The location IDs for the orders to query. All locations must belong to the same merchant.  Min: 1 location ID.  Max: 10 location IDs.
	LocationIds []string `json:"location_ids,omitempty"`
	// 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:"cursor,omitempty"`
	// Query conditions used to filter or sort the results. Note that when retrieving additional pages using a cursor, you must use the original query.
	Query *SearchOrdersQuery `json:"query,omitempty"`
	// The maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page.  Default: `500`
	Limit int32 `json:"limit,omitempty"`
	// A Boolean that controls the format of the search results. If `true`, `SearchOrders` returns [OrderEntry](https://developer.squareup.com/reference/square_2023-12-13/objects/OrderEntry) objects. If `false`, `SearchOrders` returns complete order objects.  Default: `false`.
	ReturnEntries bool `json:"return_entries,omitempty"`
}

The request does not have any required fields. When given no query criteria, `SearchOrders` returns all results for all of the seller's locations. When retrieving additional pages using a `cursor`, the `query` must be equal to the `query` used to retrieve the first page of results.

type SearchOrdersResponse

type SearchOrdersResponse struct {
	// A list of [OrderEntries](https://developer.squareup.com/reference/square_2023-12-13/objects/OrderEntry) that fit the query conditions. The list is populated only if `return_entries` is set to `true` in the request.
	OrderEntries []OrderEntry `json:"order_entries,omitempty"`
	// A list of [Order](https://developer.squareup.com/reference/square_2023-12-13/objects/Order) objects that match the query conditions. The list is populated only if `return_entries` is set to `false` in the request.
	Orders []Order `json:"orders,omitempty"`
	// The pagination cursor to be used in a subsequent request. If unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
	Cursor string `json:"cursor,omitempty"`
	// [Errors](https://developer.squareup.com/reference/square_2023-12-13/objects/Error) encountered during the search.
	Errors []ModelError `json:"errors,omitempty"`
}

Either the `order_entries` or `orders` field is set, depending on whether `return_entries` is set on the SearchOrdersRequest(https://developer.squareup.com/reference/square_2023-12-13/orders-api/search-orders).

type SearchOrdersSort

type SearchOrdersSort struct {
	// The field to sort by.  __Important:__ When using a [DateTimeFilter](https://developer.squareup.com/reference/square_2023-12-13/objects/SearchOrdersFilter), `sort_field` must match the timestamp field that the `DateTimeFilter` uses to filter. For example, if you set your `sort_field` to `CLOSED_AT` and you use a `DateTimeFilter`, your `DateTimeFilter` must filter for orders by their `CLOSED_AT` date. If this field does not match the timestamp field in `DateTimeFilter`, `SearchOrders` returns an error.  Default: `CREATED_AT`.
	SortField string `json:"sort_field"`
	// The chronological order in which results are returned. Defaults to `DESC`.
	SortOrder string `json:"sort_order,omitempty"`
}

Sorting criteria for a `SearchOrders` request. Results can only be sorted by a timestamp field.

type SearchOrdersSortField

type SearchOrdersSortField string

SearchOrdersSortField : Specifies which timestamp to use to sort `SearchOrder` results.

const (
	CREATED_AT_SearchOrdersSortField SearchOrdersSortField = "CREATED_AT"
	UPDATED_AT_SearchOrdersSortField SearchOrdersSortField = "UPDATED_AT"
	CLOSED_AT_SearchOrdersSortField  SearchOrdersSortField = "CLOSED_AT"
)

List of SearchOrdersSortField

type SearchOrdersSourceFilter

type SearchOrdersSourceFilter struct {
	// Filters by the [Source](https://developer.squareup.com/reference/square_2023-12-13/objects/OrderSource) `name`. The filter returns any orders with a `source.name` that matches any of the listed source names.  Max: 10 source names.
	SourceNames []string `json:"source_names,omitempty"`
}

A filter based on order `source` information.

type SearchOrdersStateFilter

type SearchOrdersStateFilter struct {
	// States to filter for.
	States []string `json:"states"`
}

Filter by the current order `state`.

type SortOrder

type SortOrder string

SortOrder : The order (e.g., chronological or alphabetical) in which results from a request are returned.

const (
	DESC_SortOrder SortOrder = "DESC"
	ASC_SortOrder  SortOrder = "ASC"
)

List of SortOrder

type TaxIds

type TaxIds struct {
	// The EU VAT number for this location. For example, `IE3426675K`. If the EU VAT number is present, it is well-formed and has been validated with VIES, the VAT Information Exchange System.
	EuVat string `json:"eu_vat,omitempty"`
	// The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements) number is a 14-digit code issued by the French INSEE. For example, `39922799000021`.
	FrSiret string `json:"fr_siret,omitempty"`
	// The French government uses the NAF (Nomenclature des Activités Françaises) to display and track economic statistical data. This is also called the APE (Activite Principale de l’Entreprise) code. For example, `6910Z`.
	FrNaf string `json:"fr_naf,omitempty"`
	// The NIF (Numero de Identificacion Fiscal) number is a nine-character tax identifier used in Spain. If it is present, it has been validated. For example, `73628495A`.
	EsNif string `json:"es_nif,omitempty"`
	// The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan. For example, `T1234567890123`.
	JpQii string `json:"jp_qii,omitempty"`
}

Identifiers for the location used by various governments for tax purposes.

type Tender

type Tender struct {
	// The tender's unique ID. It is the associated payment ID.
	Id string `json:"id,omitempty"`
	// The ID of the transaction's associated location.
	LocationId string `json:"location_id,omitempty"`
	// The ID of the tender's associated transaction.
	TransactionId string `json:"transaction_id,omitempty"`
	// The timestamp for when the tender was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// An optional note associated with the tender at the time of payment.
	Note string `json:"note,omitempty"`
	// The total amount of the tender, including `tip_money`. If the tender has a `payment_id`, the `total_money` of the corresponding [Payment](https://developer.squareup.com/reference/square_2023-12-13/objects/Payment) will be equal to the `amount_money` of the tender.
	AmountMoney *Money `json:"amount_money,omitempty"`
	// The tip's amount of the tender.
	TipMoney *Money `json:"tip_money,omitempty"`
	// The amount of any Square processing fees applied to the tender.  This field is not immediately populated when a new transaction is created. It is usually available after about ten seconds.
	ProcessingFeeMoney *Money `json:"processing_fee_money,omitempty"`
	// If the tender is associated with a customer or represents a customer's card on file, this is the ID of the associated customer.
	CustomerId string `json:"customer_id,omitempty"`
	// The type of tender, such as `CARD` or `CASH`.
	Type_ string `json:"type"`
	// The details of the card tender.  This value is present only if the value of `type` is `CARD`.
	CardDetails *TenderCardDetails `json:"card_details,omitempty"`
	// The details of the cash tender.  This value is present only if the value of `type` is `CASH`.
	CashDetails *TenderCashDetails `json:"cash_details,omitempty"`
	// The details of the bank account tender.  This value is present only if the value of `type` is `BANK_ACCOUNT`.
	BankAccountDetails *TenderBankAccountDetails `json:"bank_account_details,omitempty"`
	// The details of a Buy Now Pay Later tender.  This value is present only if the value of `type` is `BUY_NOW_PAY_LATER`.
	BuyNowPayLaterDetails *TenderBuyNowPayLaterDetails `json:"buy_now_pay_later_details,omitempty"`
	// The details of a Square Account tender.  This value is present only if the value of `type` is `SQUARE_ACCOUNT`.
	SquareAccountDetails *TenderSquareAccountDetails `json:"square_account_details,omitempty"`
	// Additional recipients (other than the merchant) receiving a portion of this tender. For example, fees assessed on the purchase by a third party integration.
	AdditionalRecipients []AdditionalRecipient `json:"additional_recipients,omitempty"`
	// The ID of the [Payment](https://developer.squareup.com/reference/square_2023-12-13/objects/Payment) that corresponds to this tender. This value is only present for payments created with the v2 Payments API.
	PaymentId string `json:"payment_id,omitempty"`
}

Represents a tender (i.e., a method of payment) used in a Square transaction.

type TenderBankAccountDetails

type TenderBankAccountDetails struct {
	// The bank account payment's current state.  See [TenderBankAccountPaymentDetailsStatus](https://developer.squareup.com/reference/square_2023-12-13/enums/TenderBankAccountDetailsStatus) for possible values.
	Status string `json:"status,omitempty"`
}

Represents the details of a tender with `type` `BANK_ACCOUNT`. See [BankAccountPaymentDetails](https://developer.squareup.com/reference/square_2023-12-13/objects/BankAccountPaymentDetails) for more exposed details of a bank account payment.

type TenderBankAccountDetailsStatus

type TenderBankAccountDetailsStatus string

TenderBankAccountDetailsStatus : Indicates the bank account payment's current status.

const (
	PENDING_TenderBankAccountDetailsStatus   TenderBankAccountDetailsStatus = "PENDING"
	COMPLETED_TenderBankAccountDetailsStatus TenderBankAccountDetailsStatus = "COMPLETED"
	FAILED_TenderBankAccountDetailsStatus    TenderBankAccountDetailsStatus = "FAILED"
)

List of TenderBankAccountDetailsStatus

type TenderBuyNowPayLaterDetails

type TenderBuyNowPayLaterDetails struct {
	// The Buy Now Pay Later brand.
	BuyNowPayLaterBrand string `json:"buy_now_pay_later_brand,omitempty"`
	// The buy now pay later payment's current state (such as `AUTHORIZED` or `CAPTURED`). See [TenderBuyNowPayLaterDetailsStatus](https://developer.squareup.com/reference/square_2023-12-13/enums/TenderBuyNowPayLaterDetailsStatus) for possible values.
	Status string `json:"status,omitempty"`
}

Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`.

type TenderBuyNowPayLaterDetailsBrand

type TenderBuyNowPayLaterDetailsBrand string

TenderBuyNowPayLaterDetailsBrand :

const (
	OTHER_BRAND_TenderBuyNowPayLaterDetailsBrand TenderBuyNowPayLaterDetailsBrand = "OTHER_BRAND"
	AFTERPAY_TenderBuyNowPayLaterDetailsBrand    TenderBuyNowPayLaterDetailsBrand = "AFTERPAY"
)

List of TenderBuyNowPayLaterDetailsBrand

type TenderBuyNowPayLaterDetailsStatus

type TenderBuyNowPayLaterDetailsStatus string

TenderBuyNowPayLaterDetailsStatus :

const (
	AUTHORIZED_TenderBuyNowPayLaterDetailsStatus TenderBuyNowPayLaterDetailsStatus = "AUTHORIZED"
	CAPTURED_TenderBuyNowPayLaterDetailsStatus   TenderBuyNowPayLaterDetailsStatus = "CAPTURED"
	VOIDED_TenderBuyNowPayLaterDetailsStatus     TenderBuyNowPayLaterDetailsStatus = "VOIDED"
	FAILED_TenderBuyNowPayLaterDetailsStatus     TenderBuyNowPayLaterDetailsStatus = "FAILED"
)

List of TenderBuyNowPayLaterDetailsStatus

type TenderCardDetails

type TenderCardDetails struct {
	// The credit card payment's current state (such as `AUTHORIZED` or `CAPTURED`). See [TenderCardDetailsStatus](https://developer.squareup.com/reference/square_2023-12-13/enums/TenderCardDetailsStatus) for possible values.
	Status string `json:"status,omitempty"`
	// The credit card's non-confidential details.
	Card *Card `json:"card,omitempty"`
	// The method used to enter the card's details for the transaction.
	EntryMethod string `json:"entry_method,omitempty"`
}

Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD`

type TenderCardDetailsEntryMethod

type TenderCardDetailsEntryMethod string

TenderCardDetailsEntryMethod : Indicates the method used to enter the card's details.

const (
	SWIPED_TenderCardDetailsEntryMethod      TenderCardDetailsEntryMethod = "SWIPED"
	KEYED_TenderCardDetailsEntryMethod       TenderCardDetailsEntryMethod = "KEYED"
	EMV_TenderCardDetailsEntryMethod         TenderCardDetailsEntryMethod = "EMV"
	ON_FILE_TenderCardDetailsEntryMethod     TenderCardDetailsEntryMethod = "ON_FILE"
	CONTACTLESS_TenderCardDetailsEntryMethod TenderCardDetailsEntryMethod = "CONTACTLESS"
)

List of TenderCardDetailsEntryMethod

type TenderCardDetailsStatus

type TenderCardDetailsStatus string

TenderCardDetailsStatus : Indicates the card transaction's current status.

const (
	AUTHORIZED_TenderCardDetailsStatus TenderCardDetailsStatus = "AUTHORIZED"
	CAPTURED_TenderCardDetailsStatus   TenderCardDetailsStatus = "CAPTURED"
	VOIDED_TenderCardDetailsStatus     TenderCardDetailsStatus = "VOIDED"
	FAILED_TenderCardDetailsStatus     TenderCardDetailsStatus = "FAILED"
)

List of TenderCardDetailsStatus

type TenderCashDetails

type TenderCashDetails struct {
	// The total amount of cash provided by the buyer, before change is given.
	BuyerTenderedMoney *Money `json:"buyer_tendered_money,omitempty"`
	// The amount of change returned to the buyer.
	ChangeBackMoney *Money `json:"change_back_money,omitempty"`
}

Represents the details of a tender with `type` `CASH`.

type TenderSquareAccountDetails

type TenderSquareAccountDetails struct {
	// The Square Account payment's current state (such as `AUTHORIZED` or `CAPTURED`). See [TenderSquareAccountDetailsStatus](https://developer.squareup.com/reference/square_2023-12-13/enums/TenderSquareAccountDetailsStatus) for possible values.
	Status string `json:"status,omitempty"`
}

Represents the details of a tender with `type` `SQUARE_ACCOUNT`.

type TenderSquareAccountDetailsStatus

type TenderSquareAccountDetailsStatus string

TenderSquareAccountDetailsStatus :

const (
	AUTHORIZED_TenderSquareAccountDetailsStatus TenderSquareAccountDetailsStatus = "AUTHORIZED"
	CAPTURED_TenderSquareAccountDetailsStatus   TenderSquareAccountDetailsStatus = "CAPTURED"
	VOIDED_TenderSquareAccountDetailsStatus     TenderSquareAccountDetailsStatus = "VOIDED"
	FAILED_TenderSquareAccountDetailsStatus     TenderSquareAccountDetailsStatus = "FAILED"
)

List of TenderSquareAccountDetailsStatus

type TenderType

type TenderType string

TenderType : Indicates a tender's type.

const (
	CARD_TenderType              TenderType = "CARD"
	CASH_TenderType              TenderType = "CASH"
	THIRD_PARTY_CARD_TenderType  TenderType = "THIRD_PARTY_CARD"
	SQUARE_GIFT_CARD_TenderType  TenderType = "SQUARE_GIFT_CARD"
	NO_SALE_TenderType           TenderType = "NO_SALE"
	BANK_ACCOUNT_TenderType      TenderType = "BANK_ACCOUNT"
	WALLET_TenderType            TenderType = "WALLET"
	BUY_NOW_PAY_LATER_TenderType TenderType = "BUY_NOW_PAY_LATER"
	SQUARE_ACCOUNT_TenderType    TenderType = "SQUARE_ACCOUNT"
	OTHER_TenderType             TenderType = "OTHER"
)

List of TenderType

type TimeRange

type TimeRange struct {
	// A datetime value in RFC 3339 format indicating when the time range starts.
	StartAt string `json:"start_at,omitempty"`
	// A datetime value in RFC 3339 format indicating when the time range ends.
	EndAt string `json:"end_at,omitempty"`
}

Represents a generic time range. The start and end values are represented in RFC 3339 format. Time ranges are customized to be inclusive or exclusive based on the needs of a particular endpoint. Refer to the relevant endpoint-specific documentation to determine how time ranges are handled.

type Transaction

type Transaction struct {
	// The transaction's unique ID, issued by Square payments servers.
	Id string `json:"id,omitempty"`
	// The ID of the transaction's associated location.
	LocationId string `json:"location_id,omitempty"`
	// The timestamp for when the transaction was created, in RFC 3339 format.
	CreatedAt string `json:"created_at,omitempty"`
	// The tenders used to pay in the transaction.
	Tenders []Tender `json:"tenders,omitempty"`
	// Refunds that have been applied to any tender in the transaction.
	Refunds []Refund `json:"refunds,omitempty"`
	// If the transaction was created with the [Charge](https://developer.squareup.com/reference/square_2023-12-13/transactions-api/charge) endpoint, this value is the same as the value provided for the `reference_id` parameter in the request to that endpoint. Otherwise, it is not set.
	ReferenceId string `json:"reference_id,omitempty"`
	// The Square product that processed the transaction.
	Product string `json:"product,omitempty"`
	// If the transaction was created in the Square Point of Sale app, this value is the ID generated for the transaction by Square Point of Sale.  This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode).  It is not currently possible with the Connect API to perform a transaction lookup by this value.
	ClientId string `json:"client_id,omitempty"`
	// The shipping address provided in the request, if any.
	ShippingAddress *Address `json:"shipping_address,omitempty"`
	// The order_id is an identifier for the order associated with this transaction, if any.
	OrderId string `json:"order_id,omitempty"`
}

Represents a transaction processed with Square, either with the Connect API or with Square Point of Sale. The `tenders` field of this object lists all methods of payment used to pay in the transaction.

type UpdateCustomerCustomAttributeDefinitionRequest

type UpdateCustomerCustomAttributeDefinitionRequest struct {
	// 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 *CustomAttributeDefinition `json:"custom_attribute_definition"`
	// 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"`
}

Represents an [UpdateCustomerCustomAttributeDefinition](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api/update-customer-custom-attribute-definition) request.

type UpdateCustomerCustomAttributeDefinitionResponse

type UpdateCustomerCustomAttributeDefinitionResponse struct {
	// The updated custom attribute definition.
	CustomAttributeDefinition *CustomAttributeDefinition `json:"custom_attribute_definition,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents an [UpdateCustomerCustomAttributeDefinition](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api/update-customer-custom-attribute-definition) response. Either `custom_attribute_definition` or `errors` is present in the response.

type UpdateCustomerGroupRequest

type UpdateCustomerGroupRequest struct {
	// The `CustomerGroup` object including all the updates you want to make.
	Group *CustomerGroup `json:"group"`
}

Defines the body parameters that can be included in a request to the [UpdateCustomerGroup](https://developer.squareup.com/reference/square_2023-12-13/customer-groups-api/update-customer-group) endpoint.

type UpdateCustomerGroupResponse

type UpdateCustomerGroupResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The successfully updated customer group.
	Group *CustomerGroup `json:"group,omitempty"`
}

Defines the fields that are included in the response body of a request to the [UpdateCustomerGroup](https://developer.squareup.com/reference/square_2023-12-13/customer-groups-api/update-customer-group) endpoint. Either `errors` or `group` is present in a given response (never both).

type UpdateCustomerRequest

type UpdateCustomerRequest struct {
	// The given name (that is, the first name) associated with the customer profile.  The maximum length for this value is 300 characters.
	GivenName string `json:"given_name,omitempty"`
	// The family name (that is, the last name) associated with the customer profile.  The maximum length for this value is 300 characters.
	FamilyName string `json:"family_name,omitempty"`
	// A business name associated with the customer profile.  The maximum length for this value is 500 characters.
	CompanyName string `json:"company_name,omitempty"`
	// A nickname for the customer profile.  The maximum length for this value is 100 characters.
	Nickname string `json:"nickname,omitempty"`
	// The email address associated with the customer profile.  The maximum length for this value is 254 characters.
	EmailAddress string `json:"email_address,omitempty"`
	// The physical address associated with the customer profile. Only new or changed fields are required in the request.  For maximum length constraints, see [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). The `first_name` and `last_name` fields are ignored if they are present in the request.
	Address *Address `json:"address,omitempty"`
	// The phone number associated with the customer profile. The phone number must be valid and can contain 9–16 digits, with an optional `+` prefix and country code. For more information, see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).
	PhoneNumber string `json:"phone_number,omitempty"`
	// An optional second ID used to associate the customer profile with an entity in another system.  The maximum length for this value is 100 characters.
	ReferenceId string `json:"reference_id,omitempty"`
	// A custom note associated with the customer profile.
	Note string `json:"note,omitempty"`
	// The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.
	Birthday string `json:"birthday,omitempty"`
	// The current version of the customer profile.  As a best practice, you should include this field to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile).
	Version int64 `json:"version,omitempty"`
	// The tax ID associated with the customer profile. This field is available only for customers of sellers in EU countries or the United Kingdom.  In other countries, this field is ignored when included in an `UpdateCustomer` request. For more information,  see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).
	TaxIds *CustomerTaxIds `json:"tax_ids,omitempty"`
}

Defines the body parameters that can be included in a request to the `UpdateCustomer` endpoint.

type UpdateCustomerResponse

type UpdateCustomerResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The updated customer.
	Customer *Customer `json:"customer,omitempty"`
}

Defines the fields that are included in the response body of a request to the `UpdateCustomer` endpoint. Either `errors` or `customer` is present in a given response (never both).

type UpdateOrderCustomAttributeDefinitionRequest

type UpdateOrderCustomAttributeDefinitionRequest struct {
	// 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.  For more information, see  [Updatable definition fields](https://developer.squareup.com/docs/orders-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 *CustomAttributeDefinition `json:"custom_attribute_definition"`
	// 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"`
}

Represents an update request for an order custom attribute definition.

type UpdateOrderCustomAttributeDefinitionResponse

type UpdateOrderCustomAttributeDefinitionResponse struct {
	// The updated order custom attribute definition.
	CustomAttributeDefinition *CustomAttributeDefinition `json:"custom_attribute_definition,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from updating an order custom attribute definition.

type UpdateOrderRequest

type UpdateOrderRequest struct {
	// The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) containing only the fields to update and the version to which the update is being applied.
	Order *Order `json:"order,omitempty"`
	// The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) fields to clear. For example, `line_items[uid].note`. For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#deleting-fields).
	FieldsToClear []string `json:"fields_to_clear,omitempty"`
	// A value you specify that uniquely identifies this update request.  If you are unsure whether a particular update was applied to an order successfully, you can reattempt it with the same idempotency key without worrying about creating duplicate updates to the order. The latest order version is returned.  For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
	IdempotencyKey string `json:"idempotency_key,omitempty"`
}

Defines the fields that are included in requests to the [UpdateOrder](https://developer.squareup.com/reference/square_2023-12-13/orders-api/update-order) endpoint.

type UpdateOrderResponse

type UpdateOrderResponse struct {
	// The updated order.
	Order *Order `json:"order,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the [UpdateOrder](https://developer.squareup.com/reference/square_2023-12-13/orders-api/update-order) endpoint.

type UpdatePaymentRequest

type UpdatePaymentRequest struct {
	// The updated `Payment` object.
	Payment *Payment `json:"payment,omitempty"`
	// A unique string that identifies this `UpdatePayment` request. Keys can be any valid string but must be unique for every `UpdatePayment` request.  For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
	IdempotencyKey string `json:"idempotency_key"`
}

Describes a request to update a payment using [UpdatePayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/update-payment).

type UpdatePaymentResponse

type UpdatePaymentResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
	// The updated payment.
	Payment *Payment `json:"payment,omitempty"`
}

Defines the response returned by [UpdatePayment](https://developer.squareup.com/reference/square_2023-12-13/payments-api/update-payment).

type UpsertCustomerCustomAttributeRequest

type UpsertCustomerCustomAttributeRequest struct {
	// 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 *CustomAttribute `json:"custom_attribute"`
	// 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"`
}

Represents an [UpsertCustomerCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api/upsert-customer-custom-attribute) request.

type UpsertCustomerCustomAttributeResponse

type UpsertCustomerCustomAttributeResponse struct {
	// The new or updated custom attribute.
	CustomAttribute *CustomAttribute `json:"custom_attribute,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents an [UpsertCustomerCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/customer-custom-attributes-api/upsert-customer-custom-attribute) response. Either `custom_attribute_definition` or `errors` is present in the response.

type UpsertLocationCustomAttributeRequest

type UpsertLocationCustomAttributeRequest struct {
	// 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 [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-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 the current version of the custom attribute. If this is not important for your application, version can be set to -1.
	CustomAttribute *CustomAttribute `json:"custom_attribute"`
	// 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"`
}

Represents an [UpsertLocationCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/location-custom-attributes-api/upsert-location-custom-attribute) request.

type UpsertLocationCustomAttributeResponse

type UpsertLocationCustomAttributeResponse struct {
	// The new or updated custom attribute.
	CustomAttribute *CustomAttribute `json:"custom_attribute,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents an [UpsertLocationCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/location-custom-attributes-api/upsert-location-custom-attribute) response. Either `custom_attribute_definition` or `errors` is present in the response.

type UpsertMerchantCustomAttributeRequest

type UpsertMerchantCustomAttributeRequest struct {
	// 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 [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). - The version field must match the current version of the custom attribute definition to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) If this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error.
	CustomAttribute *CustomAttribute `json:"custom_attribute"`
	// 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"`
}

Represents an [UpsertMerchantCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/merchant-custom-attributes-api/upsert-merchant-custom-attribute) request.

type UpsertMerchantCustomAttributeResponse

type UpsertMerchantCustomAttributeResponse struct {
	// The new or updated custom attribute.
	CustomAttribute *CustomAttribute `json:"custom_attribute,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents an [UpsertMerchantCustomAttribute](https://developer.squareup.com/reference/square_2023-12-13/merchant-custom-attributes-api/upsert-merchant-custom-attribute) response. Either `custom_attribute_definition` or `errors` is present in the response.

type UpsertOrderCustomAttributeRequest

type UpsertOrderCustomAttributeRequest struct {
	// 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, include this optional field and specify the current version of the custom attribute.
	CustomAttribute *CustomAttribute `json:"custom_attribute"`
	// 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"`
}

Represents an upsert request for an order custom attribute.

type UpsertOrderCustomAttributeResponse

type UpsertOrderCustomAttributeResponse struct {
	// The order custom attribute that was created or modified.
	CustomAttribute *CustomAttribute `json:"custom_attribute,omitempty"`
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Represents a response from upserting order custom attribute definitions.

type VoidTransactionRequest

type VoidTransactionRequest struct {
}

type VoidTransactionResponse

type VoidTransactionResponse struct {
	// Any errors that occurred during the request.
	Errors []ModelError `json:"errors,omitempty"`
}

Defines the fields that are included in the response body of a request to the [VoidTransaction](https://developer.squareup.com/reference/square_2023-12-13/transactions-api/void-transaction) endpoint.

Source Files

Jump to

Keyboard shortcuts

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