Skip to content

heymegabyte/agent-skills / skills/square

square

Verified

Square API skill — auto-forged from OpenAPI 2.0. Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.

FileKindSize
SKILL.mdskill md23.2 KB
client.tsscript77.7 KB
types.tsscript415.4 KB
// Auto-generated by forge-skill-from-openapi
// API: square
// Source: Square v2.0
// DO NOT EDIT — re-run forge to regenerate

/** ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. */
export type ACHDetails = {
  "routing_number"?: string;
  "account_number_suffix"?: string;
  "account_type"?: string;
};

/** Defines the fields in an `AcceptDispute` response. */
export type AcceptDisputeResponse = {
  "errors"?: Array<Error>;
  "dispute"?: Dispute;
};

export type AcceptedPaymentMethods = {
  "apple_pay"?: boolean;
  "google_pay"?: boolean;
  "cash_app_pay"?: boolean;
  "afterpay_clearpay"?: boolean;
};

/** Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) request. */
export type AccumulateLoyaltyPointsRequest = {
  "accumulate_points": LoyaltyEventAccumulatePoints;
  "idempotency_key": string;
  "location_id": string;
};

/** Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) response. */
export type AccumulateLoyaltyPointsResponse = {
  "errors"?: Array<Error>;
  "event"?: LoyaltyEvent;
  "events"?: Array<LoyaltyEvent>;
};

export type ActionCancelReason = "BUYER_CANCELED" | "SELLER_CANCELED" | "TIMED_OUT";

export type ActivityType = "ADJUSTMENT" | "APP_FEE_REFUND" | "APP_FEE_REVENUE" | "AUTOMATIC_SAVINGS" | "AUTOMATIC_SAVINGS_REVERSED" | "CHARGE" | "DEPOSIT_FEE" | "DEPOSIT_FEE_REVERSED" | "DISPUTE" | "ESCHEATMENT" | "FEE" | "FREE_PROCESSING" | "HOLD_ADJUSTMENT" | "INITIAL_BALANCE_CHANGE" | "MONEY_TRANSFER" | "MONEY_TRANSFER_REVERSAL" | "OPEN_DISPUTE" | "OTHER" | "OTHER_ADJUSTMENT" | "PAID_SERVICE_FEE" | "PAID_SERVICE_FEE_REFUND" | "REDEMPTION_CODE" | "REFUND" | "RELEASE_ADJUSTMENT" | "RESERVE_HOLD" | "RESERVE_RELEASE" | "RETURNED_PAYOUT" | "SQUARE_CAPITAL_PAYMENT" | "SQUARE_CAPITAL_REVERSED_PAYMENT" | "SUBSCRIPTION_FEE" | "SUBSCRIPTION_FEE_PAID_REFUND" | "SUBSCRIPTION_FEE_REFUND" | "TAX_ON_FEE" | "THIRD_PARTY_FEE" | "THIRD_PARTY_FEE_REFUND" | "PAYOUT" | "AUTOMATIC_BITCOIN_CONVERSIONS" | "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED" | "CREDIT_CARD_REPAYMENT" | "CREDIT_CARD_REPAYMENT_REVERSED" | "LOCAL_OFFERS_CASHBACK" | "LOCAL_OFFERS_FEE" | "PERCENTAGE_PROCESSING_ENROLLMENT" | "PERCENTAGE_PROCESSING_DEACTIVATION" | "PERCENTAGE_PROCESSING_REPAYMENT" | "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED" | "PROCESSING_FEE" | "PROCESSING_FEE_REFUND" | "UNDO_PROCESSING_FEE_REFUND" | "GIFT_CARD_LOAD_FEE" | "GIFT_CARD_LOAD_FEE_REFUND" | "UNDO_GIFT_CARD_LOAD_FEE_REFUND" | "BALANCE_FOLDERS_TRANSFER" | "BALANCE_FOLDERS_TRANSFER_REVERSED" | "GIFT_CARD_POOL_TRANSFER" | "GIFT_CARD_POOL_TRANSFER_REVERSED" | "SQUARE_PAYROLL_TRANSFER" | "SQUARE_PAYROLL_TRANSFER_REVERSED";

/** Defines the fields that are included in the response body of
a request to the [AddGroupToCustomer](api-endpoint:Customers-AddGroupToCustomer) endpoint. */
export type AddGroupToCustomerResponse = {
  "errors"?: Array<Error>;
};

/** Represents an additional recipient (other than the merchant) receiving a portion of this tender. */
export type AdditionalRecipient = {
  "location_id": string;
  "description"?: string;
  "amount_money": Money;
  "receivable_id"?: string;
};

/** Represents a postal address in a country. 
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). */
export type Address = {
  "address_line_1"?: string;
  "address_line_2"?: string;
  "address_line_3"?: string;
  "locality"?: string;
  "sublocality"?: string;
  "sublocality_2"?: string;
  "sublocality_3"?: string;
  "administrative_district_level_1"?: string;
  "administrative_district_level_2"?: string;
  "administrative_district_level_3"?: string;
  "postal_code"?: string;
  "country"?: Country;
  "first_name"?: string;
  "last_name"?: string;
};

/** Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request. */
export type AdjustLoyaltyPointsRequest = {
  "idempotency_key": string;
  "adjust_points": LoyaltyEventAdjustPoints;
  "allow_negative_balance"?: boolean;
};

/** Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request. */
export type AdjustLoyaltyPointsResponse = {
  "errors"?: Array<Error>;
  "event"?: LoyaltyEvent;
};

/** Additional details about Afterpay payments. */
export type AfterpayDetails = {
  "email_address"?: string;
};

/** Details about the application that took the payment. */
export type ApplicationDetails = {
  "square_product"?: ApplicationDetailsExternalSquareProduct;
  "application_id"?: string;
};

/** A list of products to return to external callers. */
export type ApplicationDetailsExternalSquareProduct = "APPOINTMENTS" | "ECOMMERCE_API" | "INVOICES" | "ONLINE_STORE" | "OTHER" | "RESTAURANTS" | "RETAIL" | "SQUARE_POS" | "TERMINAL_API" | "VIRTUAL_TERMINAL";

export type ApplicationType = "TERMINAL_API";

/** Defines an appointment segment of a booking. */
export type AppointmentSegment = {
  "duration_minutes"?: number;
  "service_variation_id"?: string;
  "team_member_id": string;
  "service_variation_version"?: number;
  "intermission_minutes"?: number;
  "any_team_member"?: boolean;
  "resource_ids"?: Array<string>;
};

/** Defines the values for the `archived_state` query expression 
used in [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) 
to return the archived, not archived or either type of catalog items. */
export type ArchivedState = "ARCHIVED_STATE_NOT_ARCHIVED" | "ARCHIVED_STATE_ARCHIVED" | "ARCHIVED_STATE_ALL";

/** Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking. */
export type Availability = {
  "start_at"?: string;
  "location_id"?: string;
  "appointment_segments"?: Array<AppointmentSegment>;
};

/** Represents a bank account. For more information about 
linking a bank account to a Square account, see 
[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api). */
export type BankAccount = {
  "id": string;
  "account_number_suffix": string;
  "country": Country;
  "currency": Currency;
  "account_type": BankAccountType;
  "holder_name": string;
  "primary_bank_identification_number": string;
  "secondary_bank_identification_number"?: string;
  "debit_mandate_reference_id"?: string;
  "reference_id"?: string;
  "location_id"?: string;
  "status": BankAccountStatus;
  "creditable": boolean;
  "debitable": boolean;
  "fingerprint"?: string;
  "version"?: number;
  "bank_name"?: string;
  "customer_id"?: string;
};

/** Published when you link an external bank account to a Square
account in the Seller Dashboard. Square sets the initial status to
`VERIFICATION_IN_PROGRESS` and publishes the event. */
export type BankAccountCreatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: BankAccountCreatedEventData;
};

export type BankAccountCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: BankAccountCreatedEventObject;
};

export type BankAccountCreatedEventObject = {
  "bank_account"?: BankAccount;
};

/** Published when Square sets the status of a
[BankAccount](entity:BankAccount) to `DISABLED`. */
export type BankAccountDisabledEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: BankAccountDisabledEventData;
};

export type BankAccountDisabledEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: BankAccountDisabledEventObject;
};

export type BankAccountDisabledEventObject = {
  "bank_account"?: BankAccount;
};

/** Additional details about BANK_ACCOUNT type payments. */
export type BankAccountPaymentDetails = {
  "bank_name"?: string;
  "transfer_type"?: string;
  "account_ownership_type"?: string;
  "fingerprint"?: string;
  "country"?: string;
  "statement_description"?: string;
  "ach_details"?: ACHDetails;
  "errors"?: Array<Error>;
};

/** Indicates the current verification status of a `BankAccount` object. */
export type BankAccountStatus = "VERIFICATION_IN_PROGRESS" | "VERIFIED" | "DISABLED";

/** Indicates the financial purpose of the bank account. */
export type BankAccountType = "CHECKING" | "SAVINGS" | "INVESTMENT" | "OTHER" | "BUSINESS_CHECKING";

/** Published when Square sets the status of a
[BankAccount](entity:BankAccount) to `VERIFIED`. */
export type BankAccountVerifiedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: BankAccountVerifiedEventData;
};

export type BankAccountVerifiedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: BankAccountVerifiedEventObject;
};

export type BankAccountVerifiedEventObject = {
  "bank_account"?: BankAccount;
};

export type BatchChangeInventoryRequest = {
  "idempotency_key": string;
  "changes"?: Array<InventoryChange>;
  "ignore_unchanged_counts"?: boolean;
};

export type BatchChangeInventoryResponse = {
  "errors"?: Array<Error>;
  "counts"?: Array<InventoryCount>;
  "changes"?: Array<InventoryChange>;
};

export type BatchDeleteCatalogObjectsRequest = {
  "object_ids": Array<string>;
};

export type BatchDeleteCatalogObjectsResponse = {
  "errors"?: Array<Error>;
  "deleted_object_ids"?: Array<string>;
  "deleted_at"?: string;
};

export type BatchRetrieveCatalogObjectsRequest = {
  "object_ids": Array<string>;
  "include_related_objects"?: boolean;
  "catalog_version"?: number;
  "include_deleted_objects"?: boolean;
  "include_category_path_to_root"?: boolean;
};

export type BatchRetrieveCatalogObjectsResponse = {
  "errors"?: Array<Error>;
  "objects"?: Array<CatalogObject>;
  "related_objects"?: Array<CatalogObject>;
};

export type BatchRetrieveInventoryChangesRequest = {
  "catalog_object_ids"?: Array<string>;
  "location_ids"?: Array<string>;
  "types"?: Array<InventoryChangeType>;
  "states"?: Array<InventoryState>;
  "updated_after"?: string;
  "updated_before"?: string;
  "cursor"?: string;
  "limit"?: number;
};

export type BatchRetrieveInventoryChangesResponse = {
  "errors"?: Array<Error>;
  "changes"?: Array<InventoryChange>;
  "cursor"?: string;
};

export type BatchRetrieveInventoryCountsRequest = {
  "catalog_object_ids"?: Array<string>;
  "location_ids"?: Array<string>;
  "updated_after"?: string;
  "cursor"?: string;
  "states"?: Array<InventoryState>;
  "limit"?: number;
};

export type BatchRetrieveInventoryCountsResponse = {
  "errors"?: Array<Error>;
  "counts"?: Array<InventoryCount>;
  "cursor"?: string;
};

/** Defines the fields that are included in requests to the
`BatchRetrieveOrders` endpoint. */
export type BatchRetrieveOrdersRequest = {
  "location_id"?: string;
  "order_ids": Array<string>;
};

/** Defines the fields that are included in the response body of
a request to the `BatchRetrieveOrders` endpoint. */
export type BatchRetrieveOrdersResponse = {
  "orders"?: Array<Order>;
  "errors"?: Array<Error>;
};

export type BatchUpsertCatalogObjectsRequest = {
  "idempotency_key": string;
  "batches": Array<CatalogObjectBatch>;
};

export type BatchUpsertCatalogObjectsResponse = {
  "errors"?: Array<Error>;
  "objects"?: Array<CatalogObject>;
  "updated_at"?: string;
  "id_mappings"?: Array<CatalogIdMapping>;
};

/** Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service
at a given location to a requesting customer in one or more appointment segments. */
export type Booking = {
  "id"?: string;
  "version"?: number;
  "status"?: BookingStatus;
  "created_at"?: string;
  "updated_at"?: string;
  "start_at"?: string;
  "location_id"?: string;
  "customer_id"?: string;
  "customer_note"?: string;
  "seller_note"?: string;
  "appointment_segments"?: Array<AppointmentSegment>;
  "transition_time_minutes"?: number;
  "all_day"?: boolean;
  "location_type"?: BusinessAppointmentSettingsBookingLocationType;
  "creator_details"?: BookingCreatorDetails;
  "source"?: BookingBookingSource;
  "address"?: Address;
};

/** Supported sources a booking was created from. */
export type BookingBookingSource = "FIRST_PARTY_MERCHANT" | "FIRST_PARTY_BUYER" | "THIRD_PARTY_BUYER" | "API";

/** Published when a booking is created.

To receive this event with buyer-level permissions, you must have `APPOINTMENTS_READ` set for the OAuth scope.  
To receive this event with seller-level permissions, you must have `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope. */
export type BookingCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: BookingCreatedEventData;
};

export type BookingCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: BookingCreatedEventObject;
};

export type BookingCreatedEventObject = {
  "booking"?: Booking;
};

/** Information about a booking creator. */
export type BookingCreatorDetails = {
  "creator_type"?: BookingCreatorDetailsCreatorType;
  "team_member_id"?: string;
  "customer_id"?: string;
};

/** Supported types of a booking creator. */
export type BookingCreatorDetailsCreatorType = "TEAM_MEMBER" | "CUSTOMER";

/** Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) 
is created by the subscribing application. Subscribe to this event to be notified 
when your application creates a booking custom attribute definition. */
export type BookingCustomAttributeDefinitionOwnedCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) 
is deleted by the subscribing application. Subscribe to this event to be notified 
when your application deletes a booking custom attribute definition. */
export type BookingCustomAttributeDefinitionOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) 
is updated by the subscribing application. Subscribe to this event to be notified 
when your application updates a booking custom attribute definition. */
export type BookingCustomAttributeDefinitionOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) 
with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is created.
An application that subscribes to this event is notified when a booking custom attribute definition is created 
by any application for which the subscribing application has read access to the booking custom attribute definition. */
export type BookingCustomAttributeDefinitionVisibleCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) 
with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.
An application that subscribes to this event is notified when a booking custom attribute definition is deleted 
by any application for which the subscribing application has read access to the booking custom attribute definition. */
export type BookingCustomAttributeDefinitionVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) 
with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.
An application that subscribes to this event is notified when a booking custom attribute definition is updated 
by any application for which the subscribing application has read access to the booking custom attribute definition. */
export type BookingCustomAttributeDefinitionVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Represents an individual delete request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes)
request. An individual request contains a booking ID, the custom attribute to delete, and an optional idempotency key. */
export type BookingCustomAttributeDeleteRequest = {
  "booking_id": string;
  "key": string;
};

/** Represents a response for an individual upsert request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) operation. */
export type BookingCustomAttributeDeleteResponse = {
  "booking_id"?: string;
  "errors"?: Array<Error>;
};

/** Published when a booking [custom attribute](entity:CustomAttribute) 
associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is
owned by the subscribing application is deleted.
Subscribe to this event to be notified 
when your application deletes a booking custom attribute. */
export type BookingCustomAttributeOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a booking [custom attribute](entity:CustomAttribute) 
is updated by the subscribing application. Subscribe to this event to be notified 
when your application updates a booking custom attribute. */
export type BookingCustomAttributeOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Represents an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes)
request. An individual request contains a booking ID, the custom attribute to create or update,
and an optional idempotency key. */
export type BookingCustomAttributeUpsertRequest = {
  "booking_id": string;
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents a response for an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) operation. */
export type BookingCustomAttributeUpsertResponse = {
  "booking_id"?: string;
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Published when a booking [custom attribute](entity:CustomAttribute) with
the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.
An application that subscribes to this event is notified when a booking custom attribute is deleted 
by any application for which the subscribing application has read access to the booking custom attribute. */
export type BookingCustomAttributeVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a booking [custom attribute](entity:CustomAttribute) 
with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.
An application that subscribes to this event is notified when a booking custom attribute is updated 
by any application for which the subscribing application has read access to the booking custom attribute. */
export type BookingCustomAttributeVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Supported booking statuses. */
export type BookingStatus = "PENDING" | "CANCELLED_BY_CUSTOMER" | "CANCELLED_BY_SELLER" | "DECLINED" | "ACCEPTED" | "NO_SHOW";

/** Published when a booking is updated or cancelled.

To receive this event with buyer-level permissions, you must have `APPOINTMENTS_READ` set for the OAuth scope.  
To receive this event with seller-level permissions, you must have `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope. */
export type BookingUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: BookingUpdatedEventData;
};

export type BookingUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: BookingUpdatedEventObject;
};

export type BookingUpdatedEventObject = {
  "booking"?: Booking;
};

/** A record of a team member's break on a [timecard](entity:Timecard). */
export type Break = {
  "id"?: string;
  "start_at": string;
  "end_at"?: string;
  "break_type_id": string;
  "name": string;
  "expected_duration": string;
  "is_paid": boolean;
};

/** A template for a type of [break](entity:Break) that can be added to a
[timecard](entity:Timecard), including the expected duration and paid status. */
export type BreakType = {
  "id"?: string;
  "location_id": string;
  "break_name": string;
  "expected_duration": string;
  "is_paid": boolean;
  "version"?: number;
  "created_at"?: string;
  "updated_at"?: string;
};

/** Defines the customer data provided in individual create requests for a
[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) operation. */
export type BulkCreateCustomerData = {
  "given_name"?: string;
  "family_name"?: string;
  "company_name"?: string;
  "nickname"?: string;
  "email_address"?: string;
  "address"?: Address;
  "phone_number"?: string;
  "reference_id"?: string;
  "note"?: string;
  "birthday"?: string;
  "tax_ids"?: CustomerTaxIds;
};

/** Defines the body parameters that can be included in requests to the
[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint. */
export type BulkCreateCustomersRequest = {
  "customers": Record<string, BulkCreateCustomerData>;
};

/** Defines the fields included in the response body from the
[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint. */
export type BulkCreateCustomersResponse = {
  "responses"?: Record<string, CreateCustomerResponse>;
  "errors"?: Array<Error>;
};

/** Represents a bulk create request for `TeamMember` objects. */
export type BulkCreateTeamMembersRequest = {
  "team_members": Record<string, CreateTeamMemberRequest>;
};

/** Represents a response from a bulk create request containing the created `TeamMember` objects or error messages. */
export type BulkCreateTeamMembersResponse = {
  "team_members"?: Record<string, CreateTeamMemberResponse>;
  "errors"?: Array<Error>;
};

/** Represents an input to a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors). */
export type BulkCreateVendorsRequest = {
  "vendors": Record<string, Vendor>;
};

/** Represents an output from a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors). */
export type BulkCreateVendorsResponse = {
  "errors"?: Array<Error>;
  "responses"?: Record<string, CreateVendorResponse>;
};

/** Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) request. */
export type BulkDeleteBookingCustomAttributesRequest = {
  "values": Record<string, BookingCustomAttributeDeleteRequest>;
};

/** Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) response,
which contains a map of responses that each corresponds to an individual delete request. */
export type BulkDeleteBookingCustomAttributesResponse = {
  "values"?: Record<string, BookingCustomAttributeDeleteResponse>;
  "errors"?: Array<Error>;
};

/** Defines the body parameters that can be included in requests to the
[BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint. */
export type BulkDeleteCustomersRequest = {
  "customer_ids": Array<string>;
};

/** Defines the fields included in the response body from the
[BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint. */
export type BulkDeleteCustomersResponse = {
  "responses"?: Record<string, DeleteCustomerResponse>;
  "errors"?: Array<Error>;
};

/** Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) request. */
export type BulkDeleteLocationCustomAttributesRequest = {
  "values": Record<string, BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest>;
};

/** Represents an individual delete request in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes)
request. An individual request contains an optional ID of the associated custom attribute definition
and optional key of the associated custom attribute definition. */
export type BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest = {
  "key"?: string;
};

/** Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) response,
which contains a map of responses that each corresponds to an individual delete request. */
export type BulkDeleteLocationCustomAttributesResponse = {
  "values": Record<string, BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse>;
  "errors"?: Array<Error>;
};

/** Represents an individual delete response in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes)
request. */
export type BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse = {
  "location_id"?: string;
  "errors"?: Array<Error>;
};

/** Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) request. */
export type BulkDeleteMerchantCustomAttributesRequest = {
  "values": Record<string, BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest>;
};

/** Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes)
request. An individual request contains an optional ID of the associated custom attribute definition
and optional key of the associated custom attribute definition. */
export type BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest = {
  "key"?: string;
};

/** Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) response,
which contains a map of responses that each corresponds to an individual delete request. */
export type BulkDeleteMerchantCustomAttributesResponse = {
  "values": Record<string, BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse>;
  "errors"?: Array<Error>;
};

/** Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes)
request. */
export type BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse = {
  "errors"?: Array<Error>;
};

/** Represents a bulk delete request for one or more order custom attributes. */
export type BulkDeleteOrderCustomAttributesRequest = {
  "values": Record<string, BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute>;
};

/** Represents one delete within the bulk operation. */
export type BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute = {
  "key"?: string;
  "order_id": string;
};

/** Represents a response from deleting one or more order custom attributes. */
export type BulkDeleteOrderCustomAttributesResponse = {
  "errors"?: Array<Error>;
  "values": Record<string, DeleteOrderCustomAttributeResponse>;
};

/** Represents options for an individual publish request in a
[BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts)
operation, provided as the value in a key-value pair. */
export type BulkPublishScheduledShiftsData = {
  "version"?: number;
};

/** Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) request. */
export type BulkPublishScheduledShiftsRequest = {
  "scheduled_shifts": Record<string, BulkPublishScheduledShiftsData>;
  "scheduled_shift_notification_audience"?: ScheduledShiftNotificationAudience;
};

/** Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) response.
Either `scheduled_shifts` or `errors` is present in the response. */
export type BulkPublishScheduledShiftsResponse = {
  "responses"?: Record<string, PublishScheduledShiftResponse>;
  "errors"?: Array<Error>;
};

/** Request payload for bulk retrieval of bookings. */
export type BulkRetrieveBookingsRequest = {
  "booking_ids": Array<string>;
};

/** Response payload for bulk retrieval of bookings. */
export type BulkRetrieveBookingsResponse = {
  "bookings"?: Record<string, RetrieveBookingResponse>;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the request body for the
[BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) endpoint. */
export type BulkRetrieveChannelsRequest = {
  "channel_ids": Array<string>;
};

export type BulkRetrieveChannelsRequestConstants = "MAX_BATCH_SIZE";

/** Defines the fields that are included in the request body for the
[BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) endpoint. */
export type BulkRetrieveChannelsResponse = {
  "errors"?: Array<Error>;
  "responses"?: Record<string, RetrieveChannelResponse>;
};

/** Defines the body parameters that can be included in requests to the
[BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint. */
export type BulkRetrieveCustomersRequest = {
  "customer_ids": Array<string>;
};

/** Defines the fields included in the response body from the
[BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint. */
export type BulkRetrieveCustomersResponse = {
  "responses"?: Record<string, RetrieveCustomerResponse>;
  "errors"?: Array<Error>;
};

/** Request payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint. */
export type BulkRetrieveTeamMemberBookingProfilesRequest = {
  "team_member_ids": Array<string>;
};

/** Response payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint. */
export type BulkRetrieveTeamMemberBookingProfilesResponse = {
  "team_member_booking_profiles"?: Record<string, RetrieveTeamMemberBookingProfileResponse>;
  "errors"?: Array<Error>;
};

/** Represents an input to a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors). */
export type BulkRetrieveVendorsRequest = {
  "vendor_ids"?: Array<string>;
};

/** Represents an output from a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors). */
export type BulkRetrieveVendorsResponse = {
  "errors"?: Array<Error>;
  "responses"?: Record<string, RetrieveVendorResponse>;
};

/** Defines input parameters in a call to the
[BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint. */
export type BulkSwapPlanRequest = {
  "new_plan_variation_id": string;
  "old_plan_variation_id": string;
  "location_id": string;
};

/** Defines output parameters in a response of the
[BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint. */
export type BulkSwapPlanResponse = {
  "errors"?: Array<Error>;
  "affected_subscriptions"?: number;
};

/** Defines the customer data provided in individual update requests for a
[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) operation. */
export type BulkUpdateCustomerData = {
  "given_name"?: string;
  "family_name"?: string;
  "company_name"?: string;
  "nickname"?: string;
  "email_address"?: string;
  "address"?: Address;
  "phone_number"?: string;
  "reference_id"?: string;
  "note"?: string;
  "birthday"?: string;
  "tax_ids"?: CustomerTaxIds;
  "version"?: number;
};

/** Defines the body parameters that can be included in requests to the
[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint. */
export type BulkUpdateCustomersRequest = {
  "customers": Record<string, BulkUpdateCustomerData>;
};

/** Defines the fields included in the response body from the
[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint. */
export type BulkUpdateCustomersResponse = {
  "responses"?: Record<string, UpdateCustomerResponse>;
  "errors"?: Array<Error>;
};

/** Represents a bulk update request for `TeamMember` objects. */
export type BulkUpdateTeamMembersRequest = {
  "team_members": Record<string, UpdateTeamMemberRequest>;
};

/** Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages. */
export type BulkUpdateTeamMembersResponse = {
  "team_members"?: Record<string, UpdateTeamMemberResponse>;
  "errors"?: Array<Error>;
};

/** Represents an input to a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors). */
export type BulkUpdateVendorsRequest = {
  "vendors": Record<string, UpdateVendorRequest>;
};

/** Represents an output from a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors). */
export type BulkUpdateVendorsResponse = {
  "errors"?: Array<Error>;
  "responses"?: Record<string, UpdateVendorResponse>;
};

/** Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) request. */
export type BulkUpsertBookingCustomAttributesRequest = {
  "values": Record<string, BookingCustomAttributeUpsertRequest>;
};

/** Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) response,
which contains a map of responses that each corresponds to an individual upsert request. */
export type BulkUpsertBookingCustomAttributesResponse = {
  "values"?: Record<string, BookingCustomAttributeUpsertResponse>;
  "errors"?: Array<Error>;
};

/** Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) request. */
export type BulkUpsertCustomerCustomAttributesRequest = {
  "values": Record<string, BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest>;
};

/** Represents an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes)
request. An individual request contains a customer ID, the custom attribute to create or update,
and an optional idempotency key. */
export type BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest = {
  "customer_id": string;
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) response,
which contains a map of responses that each corresponds to an individual upsert request. */
export type BulkUpsertCustomerCustomAttributesResponse = {
  "values"?: Record<string, BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse>;
  "errors"?: Array<Error>;
};

/** Represents a response for an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) operation. */
export type BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse = {
  "customer_id"?: string;
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) request. */
export type BulkUpsertLocationCustomAttributesRequest = {
  "values": Record<string, BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest>;
};

/** Represents an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes)
request. An individual request contains a location ID, the custom attribute to create or update,
and an optional idempotency key. */
export type BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest = {
  "location_id": string;
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) response,
which contains a map of responses that each corresponds to an individual upsert request. */
export type BulkUpsertLocationCustomAttributesResponse = {
  "values"?: Record<string, BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse>;
  "errors"?: Array<Error>;
};

/** Represents a response for an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) operation. */
export type BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse = {
  "location_id"?: string;
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) request. */
export type BulkUpsertMerchantCustomAttributesRequest = {
  "values": Record<string, BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest>;
};

/** Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes)
request. An individual request contains a merchant ID, the custom attribute to create or update,
and an optional idempotency key. */
export type BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest = {
  "merchant_id": string;
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) response,
which contains a map of responses that each corresponds to an individual upsert request. */
export type BulkUpsertMerchantCustomAttributesResponse = {
  "values"?: Record<string, BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse>;
  "errors"?: Array<Error>;
};

/** Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) operation. */
export type BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse = {
  "merchant_id"?: string;
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Represents a bulk upsert request for one or more order custom attributes. */
export type BulkUpsertOrderCustomAttributesRequest = {
  "values": Record<string, BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute>;
};

/** Represents one upsert within the bulk operation. */
export type BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute = {
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
  "order_id": string;
};

/** Represents a response from a bulk upsert of order custom attributes. */
export type BulkUpsertOrderCustomAttributesResponse = {
  "errors"?: Array<Error>;
  "values": Record<string, UpsertOrderCustomAttributeResponse>;
};

/** The service appointment settings, including where and how the service is provided. */
export type BusinessAppointmentSettings = {
  "location_types"?: Array<BusinessAppointmentSettingsBookingLocationType>;
  "alignment_time"?: BusinessAppointmentSettingsAlignmentTime;
  "min_booking_lead_time_seconds"?: number;
  "max_booking_lead_time_seconds"?: number;
  "any_team_member_booking_enabled"?: boolean;
  "multiple_service_booking_enabled"?: boolean;
  "max_appointments_per_day_limit_type"?: BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType;
  "max_appointments_per_day_limit"?: number;
  "cancellation_window_seconds"?: number;
  "cancellation_fee_money"?: Money;
  "cancellation_policy"?: BusinessAppointmentSettingsCancellationPolicy;
  "cancellation_policy_text"?: string;
  "skip_booking_flow_staff_selection"?: boolean;
};

/** Time units of a service duration for bookings. */
export type BusinessAppointmentSettingsAlignmentTime = "SERVICE_DURATION" | "QUARTER_HOURLY" | "HALF_HOURLY" | "HOURLY";

/** Supported types of location where service is provided. */
export type BusinessAppointmentSettingsBookingLocationType = "BUSINESS_LOCATION" | "CUSTOMER_LOCATION" | "PHONE";

/** The category of the seller’s cancellation policy. */
export type BusinessAppointmentSettingsCancellationPolicy = "CANCELLATION_TREATED_AS_NO_SHOW" | "CUSTOM_POLICY";

/** Types of daily appointment limits. */
export type BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType = "PER_TEAM_MEMBER" | "PER_LOCATION";

/** A seller's business booking profile, including booking policy, appointment settings, etc. */
export type BusinessBookingProfile = {
  "seller_id"?: string;
  "created_at"?: string;
  "booking_enabled"?: boolean;
  "customer_timezone_choice"?: BusinessBookingProfileCustomerTimezoneChoice;
  "booking_policy"?: BusinessBookingProfileBookingPolicy;
  "allow_user_cancel"?: boolean;
  "business_appointment_settings"?: BusinessAppointmentSettings;
  "support_seller_level_writes"?: boolean;
};

/** Policies for accepting bookings. */
export type BusinessBookingProfileBookingPolicy = "ACCEPT_ALL" | "REQUIRES_ACCEPTANCE";

/** Choices of customer-facing time zone used for bookings. */
export type BusinessBookingProfileCustomerTimezoneChoice = "BUSINESS_LOCATION_TIMEZONE" | "CUSTOMER_CHOICE";

/** The hours of operation for a location. */
export type BusinessHours = {
  "periods"?: Array<BusinessHoursPeriod>;
};

/** Represents a period of time during which a business location is open. */
export type BusinessHoursPeriod = {
  "day_of_week"?: DayOfWeek;
  "start_local_time"?: string;
  "end_local_time"?: string;
};

/** Additional details about a Buy Now Pay Later payment type. */
export type BuyNowPayLaterDetails = {
  "brand"?: string;
  "afterpay_details"?: AfterpayDetails;
  "clearpay_details"?: ClearpayDetails;
  "errors"?: Array<Error>;
};

/** Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) request. */
export type CalculateLoyaltyPointsRequest = {
  "order_id"?: string;
  "transaction_amount_money"?: Money;
  "loyalty_account_id"?: string;
};

/** Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) response. */
export type CalculateLoyaltyPointsResponse = {
  "errors"?: Array<Error>;
  "points"?: number;
  "promotion_points"?: number;
};

export type CalculateOrderRequest = {
  "order": Order;
  "proposed_rewards"?: Array<OrderReward>;
};

export type CalculateOrderResponse = {
  "order"?: Order;
  "errors"?: Array<Error>;
};

export type CancelBookingRequest = {
  "idempotency_key"?: string;
  "booking_version"?: number;
};

export type CancelBookingResponse = {
  "booking"?: Booking;
  "errors"?: Array<Error>;
};

/** Describes a `CancelInvoice` request. */
export type CancelInvoiceRequest = {
  "version": number;
};

/** The response returned by the `CancelInvoice` request. */
export type CancelInvoiceResponse = {
  "invoice"?: Invoice;
  "errors"?: Array<Error>;
};

/** Represents a [CancelLoyaltyPromotion](api-endpoint:Loyalty-CancelLoyaltyPromotion) response.
Either `loyalty_promotion` or `errors` is present in the response. */
export type CancelLoyaltyPromotionResponse = {
  "errors"?: Array<Error>;
  "loyalty_promotion"?: LoyaltyPromotion;
};

/** Describes a request to cancel a payment using
[CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey). */
export type CancelPaymentByIdempotencyKeyRequest = {
  "idempotency_key": string;
};

/** Defines the response returned by
[CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey).
On success, `errors` is empty. */
export type CancelPaymentByIdempotencyKeyResponse = {
  "errors"?: Array<Error>;
};

/** Defines the response returned by [CancelPayment](api-endpoint:Payments-CancelPayment). */
export type CancelPaymentResponse = {
  "errors"?: Array<Error>;
  "payment"?: Payment;
};

/** Defines output parameters in a response from the 
[CancelSubscription](api-endpoint:Subscriptions-CancelSubscription) endpoint. */
export type CancelSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
  "actions"?: Array<SubscriptionAction>;
};

export type CancelTerminalActionResponse = {
  "errors"?: Array<Error>;
  "action"?: TerminalAction;
};

export type CancelTerminalCheckoutResponse = {
  "errors"?: Array<Error>;
  "checkout"?: TerminalCheckout;
};

export type CancelTerminalRefundResponse = {
  "errors"?: Array<Error>;
  "refund"?: TerminalRefund;
};

/** Request to cancel a transfer order, marking any unreceived quantities as canceled */
export type CancelTransferOrderRequest = {
  "idempotency_key": string;
  "version"?: number;
};

/** Response for canceling a transfer order */
export type CancelTransferOrderResponse = {
  "transfer_order"?: TransferOrder;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint. */
export type CaptureTransactionResponse = {
  "errors"?: Array<Error>;
};

/** 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. */
export type Card = {
  "id"?: string;
  "card_brand"?: CardBrand;
  "last_4"?: string;
  "exp_month"?: number;
  "exp_year"?: number;
  "cardholder_name"?: string;
  "billing_address"?: Address;
  "fingerprint"?: string;
  "customer_id"?: string;
  "merchant_id"?: string;
  "reference_id"?: string;
  "enabled"?: boolean;
  "card_type"?: CardType;
  "prepaid_type"?: CardPrepaidType;
  "bin"?: string;
  "created_at"?: string;
  "disabled_at"?: string;
  "version"?: number;
  "card_co_brand"?: CardCoBrand;
  "issuer_alert"?: CardIssuerAlert;
  "issuer_alert_at"?: string;
  "hsa_fsa"?: boolean;
};

/** Published when Square automatically updates the expiration date or
primary account number (PAN) of a [card](entity:Card) or adds or removes an issuer alert. */
export type CardAutomaticallyUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CardAutomaticallyUpdatedEventData;
};

export type CardAutomaticallyUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CardAutomaticallyUpdatedEventObject;
};

export type CardAutomaticallyUpdatedEventObject = {
  "card"?: Card;
};

/** Indicates a card's brand, such as `VISA` or `MASTERCARD`. */
export type CardBrand = "OTHER_BRAND" | "VISA" | "MASTERCARD" | "AMERICAN_EXPRESS" | "DISCOVER" | "DISCOVER_DINERS" | "JCB" | "CHINA_UNIONPAY" | "SQUARE_GIFT_CARD" | "SQUARE_CAPITAL_CARD" | "INTERAC" | "EFTPOS" | "FELICA" | "EBT";

/** Indicates the brand for a co-branded card. */
export type CardCoBrand = "UNKNOWN" | "AFTERPAY" | "CLEARPAY";

/** Published when a [card](entity:Card) is created or imported. */
export type CardCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CardCreatedEventData;
};

export type CardCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CardCreatedEventObject;
};

export type CardCreatedEventObject = {
  "card"?: Card;
};

/** Published when a [card](entity:Card) is disabled. */
export type CardDisabledEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CardDisabledEventData;
};

export type CardDisabledEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CardDisabledEventObject;
};

export type CardDisabledEventObject = {
  "card"?: Card;
};

/** Published when a [card](entity:Card) is GDPR forgotten or vaulted. */
export type CardForgottenEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CardForgottenEventData;
};

export type CardForgottenEventCard = {
  "id"?: string;
  "customer_id"?: string;
  "enabled"?: boolean;
  "reference_id"?: string;
  "version"?: number;
  "merchant_id"?: string;
};

export type CardForgottenEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CardForgottenEventObject;
};

export type CardForgottenEventObject = {
  "card"?: CardForgottenEventCard;
};

/** Indicates the type of issuer alert for a [card on file](entity:Card). */
export type CardIssuerAlert = "ISSUER_ALERT_CARD_CLOSED";

/** Reflects the current status of a card payment. Contains only non-confidential information. */
export type CardPaymentDetails = {
  "status"?: string;
  "card"?: Card;
  "entry_method"?: string;
  "cvv_status"?: string;
  "avs_status"?: string;
  "auth_result_code"?: string;
  "application_identifier"?: string;
  "application_name"?: string;
  "application_cryptogram"?: string;
  "verification_method"?: string;
  "verification_results"?: string;
  "statement_description"?: string;
  "device_details"?: DeviceDetails;
  "card_payment_timeline"?: CardPaymentTimeline;
  "refund_requires_card_presence"?: boolean;
  "errors"?: Array<Error>;
  "applied_card_surcharge_details"?: CardSurchargeDetails;
  "wallet_type"?: string;
};

/** The timeline for card payments. */
export type CardPaymentTimeline = {
  "authorized_at"?: string;
  "captured_at"?: string;
  "voided_at"?: string;
};

/** Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. */
export type CardPrepaidType = "UNKNOWN_PREPAID_TYPE" | "NOT_PREPAID" | "PREPAID";

/** Details related to an attempt to apply a card surcharge to this payment.  When surcharge
eligibility is not known in advance, such as when the card type (debit or credit) is required
to make the eligibility determination, proposed_card_surcharge_money and
proposed_additional_amount_money will match the values in the request, while card_surcharge_money
and additional_amount_money are present only when the payment has a surcharge applied. */
export type CardSurchargeDetails = {
  "card_surcharge_money"?: Money;
};

/** Indicates a card's type, such as `CREDIT` or `DEBIT`. */
export type CardType = "UNKNOWN_CARD_TYPE" | "CREDIT" | "DEBIT";

/** Published when a [card](entity:Card) is updated by the seller in the Square Dashboard. */
export type CardUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CardUpdatedEventData;
};

export type CardUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CardUpdatedEventObject;
};

export type CardUpdatedEventObject = {
  "card"?: Card;
};

/** Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. */
export type CashAppDetails = {
  "buyer_full_name"?: string;
  "buyer_country_code"?: string;
  "buyer_cashtag"?: string;
};

export type CashDrawerDevice = {
  "id"?: string;
  "name"?: string;
};

/** The types of events on a CashDrawerShift.
Each event type represents an employee action on the actual cash drawer
represented by a CashDrawerShift. */
export type CashDrawerEventType = "NO_SALE" | "CASH_TENDER_PAYMENT" | "OTHER_TENDER_PAYMENT" | "CASH_TENDER_CANCELLED_PAYMENT" | "OTHER_TENDER_CANCELLED_PAYMENT" | "CASH_TENDER_REFUND" | "OTHER_TENDER_REFUND" | "PAID_IN" | "PAID_OUT";

/** This model gives the details of a cash drawer shift.
The cash_payment_money, cash_refund_money, cash_paid_in_money,
and cash_paid_out_money fields are all computed by summing their respective
event types. */
export type CashDrawerShift = {
  "id"?: string;
  "state"?: CashDrawerShiftState;
  "opened_at"?: string;
  "ended_at"?: string;
  "closed_at"?: string;
  "description"?: string;
  "opened_cash_money"?: Money;
  "cash_payment_money"?: Money;
  "cash_refunds_money"?: Money;
  "cash_paid_in_money"?: Money;
  "cash_paid_out_money"?: Money;
  "expected_cash_money"?: Money;
  "closed_cash_money"?: Money;
  "device"?: CashDrawerDevice;
  "created_at"?: string;
  "updated_at"?: string;
  "location_id"?: string;
  "team_member_ids"?: Array<string>;
  "opening_team_member_id"?: string;
  "ending_team_member_id"?: string;
  "closing_team_member_id"?: string;
};

export type CashDrawerShiftEvent = {
  "id"?: string;
  "event_type"?: CashDrawerEventType;
  "event_money"?: Money;
  "created_at"?: string;
  "description"?: string;
  "team_member_id"?: string;
};

/** The current state of a cash drawer shift. */
export type CashDrawerShiftState = "OPEN" | "ENDED" | "CLOSED";

/** The summary of a closed cash drawer shift.
This model contains only the money counted to start a cash drawer shift, counted
at the end of the shift, and the amount that should be in the drawer at shift
end based on summing all cash drawer shift events. */
export type CashDrawerShiftSummary = {
  "id"?: string;
  "state"?: CashDrawerShiftState;
  "opened_at"?: string;
  "ended_at"?: string;
  "closed_at"?: string;
  "description"?: string;
  "opened_cash_money"?: Money;
  "expected_cash_money"?: Money;
  "closed_cash_money"?: Money;
  "created_at"?: string;
  "updated_at"?: string;
  "location_id"?: string;
};

/** 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). */
export type CashPaymentDetails = {
  "buyer_supplied_money": Money;
  "change_back_money"?: Money;
};

/** Represents a time period of availability. */
export type CatalogAvailabilityPeriod = {
  "start_local_time"?: string;
  "end_local_time"?: string;
  "day_of_week"?: DayOfWeek;
};

/** A category to which a `CatalogItem` instance belongs. */
export type CatalogCategory = {
  "name"?: string;
  "image_ids"?: Array<string>;
  "category_type"?: CatalogCategoryType;
  "parent_category"?: CatalogObjectCategory;
  "is_top_level"?: boolean;
  "channels"?: Array<string>;
  "availability_period_ids"?: Array<string>;
  "online_visibility"?: boolean;
  "root_category"?: string;
  "ecom_seo_data"?: CatalogEcomSeoData;
  "path_to_root"?: Array<CategoryPathToRootNode>;
};

/** Indicates the type of a category. */
export type CatalogCategoryType = "REGULAR_CATEGORY" | "MENU_CATEGORY" | "KITCHEN_CATEGORY";

/** Contains information defining a custom attribute. Custom attributes are
intended to store additional information about a catalog object or to associate a
catalog object with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.).
[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) */
export type CatalogCustomAttributeDefinition = {
  "type": CatalogCustomAttributeDefinitionType;
  "name": string;
  "description"?: string;
  "source_application"?: SourceApplication;
  "allowed_object_types": Array<CatalogObjectType>;
  "seller_visibility"?: CatalogCustomAttributeDefinitionSellerVisibility;
  "app_visibility"?: CatalogCustomAttributeDefinitionAppVisibility;
  "string_config"?: CatalogCustomAttributeDefinitionStringConfig;
  "number_config"?: CatalogCustomAttributeDefinitionNumberConfig;
  "selection_config"?: CatalogCustomAttributeDefinitionSelectionConfig;
  "custom_attribute_usage_count"?: number;
  "key"?: string;
};

/** Defines the visibility of a custom attribute to applications other than their
creating application. */
export type CatalogCustomAttributeDefinitionAppVisibility = "APP_VISIBILITY_HIDDEN" | "APP_VISIBILITY_READ_ONLY" | "APP_VISIBILITY_READ_WRITE_VALUES";

export type CatalogCustomAttributeDefinitionNumberConfig = {
  "precision"?: number;
};

/** Configuration associated with `SELECTION`-type custom attribute definitions. */
export type CatalogCustomAttributeDefinitionSelectionConfig = {
  "max_allowed_selections"?: number;
  "allowed_selections"?: Array<CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection>;
};

/** A named selection for this `SELECTION`-type custom attribute definition. */
export type CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection = {
  "uid"?: string;
  "name": string;
};

/** Defines the visibility of a custom attribute to sellers in Square
client applications, Square APIs or in Square UIs (including Square Point
of Sale applications and Square Dashboard). */
export type CatalogCustomAttributeDefinitionSellerVisibility = "SELLER_VISIBILITY_HIDDEN" | "SELLER_VISIBILITY_READ_WRITE_VALUES";

/** Configuration associated with Custom Attribute Definitions of type `STRING`. */
export type CatalogCustomAttributeDefinitionStringConfig = {
  "enforce_uniqueness"?: boolean;
};

/** Defines the possible types for a custom attribute. */
export type CatalogCustomAttributeDefinitionType = "STRING" | "BOOLEAN" | "NUMBER" | "SELECTION";

/** An instance of a custom attribute. Custom attributes can be defined and
added to `ITEM` and `ITEM_VARIATION` type catalog objects.
[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes). */
export type CatalogCustomAttributeValue = {
  "name"?: string;
  "string_value"?: string;
  "custom_attribute_definition_id"?: string;
  "type"?: CatalogCustomAttributeDefinitionType;
  "number_value"?: string;
  "boolean_value"?: boolean;
  "selection_uid_values"?: Array<string>;
  "key"?: string;
};

/** A discount applicable to items. */
export type CatalogDiscount = {
  "name"?: string;
  "discount_type"?: CatalogDiscountType;
  "percentage"?: string;
  "amount_money"?: Money;
  "pin_required"?: boolean;
  "label_color"?: string;
  "modify_tax_basis"?: CatalogDiscountModifyTaxBasis;
  "maximum_amount_money"?: Money;
};

export type CatalogDiscountModifyTaxBasis = "MODIFY_TAX_BASIS" | "DO_NOT_MODIFY_TAX_BASIS";

/** How to apply a CatalogDiscount to a CatalogItem. */
export type CatalogDiscountType = "FIXED_PERCENTAGE" | "FIXED_AMOUNT" | "VARIABLE_PERCENTAGE" | "VARIABLE_AMOUNT";

/** SEO data for for a seller's Square Online store. */
export type CatalogEcomSeoData = {
  "page_title"?: string;
  "page_description"?: string;
  "permalink"?: string;
};

/** A mapping between a temporary client-supplied ID and a permanent server-generated ID.

When calling [UpsertCatalogObject](api-endpoint:Catalog-UpsertCatalogObject) or
[BatchUpsertCatalogObjects](api-endpoint:Catalog-BatchUpsertCatalogObjects) to
create a [CatalogObject](entity:CatalogObject) instance, you can supply
a temporary ID for the to-be-created object, especially when the object is to be referenced
elsewhere in the same request body. This temporary ID can be any string unique within
the call, but must be prefixed by "#".

After the request is submitted and the object created, a permanent server-generated ID is assigned
to the new object. The permanent ID is unique across the Square catalog. */
export type CatalogIdMapping = {
  "client_object_id"?: string;
  "object_id"?: string;
};

/** An image file to use in Square catalogs. It can be associated with
`CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects.
Only the images on items and item variations are exposed in Dashboard.
Only the first image on an item is displayed in Square Point of Sale (SPOS).
Images on items and variations are displayed through Square Online Store.
Images on other object types are for use by 3rd party application developers. */
export type CatalogImage = {
  "name"?: string;
  "url"?: string;
  "caption"?: string;
  "photo_studio_order_id"?: string;
};

export type CatalogInfoResponse = {
  "errors"?: Array<Error>;
  "limits"?: CatalogInfoResponseLimits;
  "standard_unit_description_group"?: StandardUnitDescriptionGroup;
};

export type CatalogInfoResponseLimits = {
  "batch_upsert_max_objects_per_batch"?: number;
  "batch_upsert_max_total_objects"?: number;
  "batch_retrieve_max_object_ids"?: number;
  "search_max_page_limit"?: number;
  "batch_delete_max_object_ids"?: number;
  "update_item_taxes_max_item_ids"?: number;
  "update_item_taxes_max_taxes_to_enable"?: number;
  "update_item_taxes_max_taxes_to_disable"?: number;
  "update_item_modifier_lists_max_item_ids"?: number;
  "update_item_modifier_lists_max_modifier_lists_to_enable"?: number;
  "update_item_modifier_lists_max_modifier_lists_to_disable"?: number;
};

/** A [CatalogObject](entity:CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog. */
export type CatalogItem = {
  "name"?: string;
  "description"?: string;
  "abbreviation"?: string;
  "label_color"?: string;
  "is_taxable"?: boolean;
  "category_id"?: string;
  "buyer_facing_name"?: string;
  "tax_ids"?: Array<string>;
  "modifier_list_info"?: Array<CatalogItemModifierListInfo>;
  "variations"?: Array<CatalogObject>;
  "product_type"?: CatalogItemProductType;
  "skip_modifier_screen"?: boolean;
  "item_options"?: Array<CatalogItemOptionForItem>;
  "ecom_uri"?: string;
  "ecom_image_uris"?: Array<string>;
  "image_ids"?: Array<string>;
  "sort_name"?: string;
  "categories"?: Array<CatalogObjectCategory>;
  "description_html"?: string;
  "description_plaintext"?: string;
  "kitchen_name"?: string;
  "channels"?: Array<string>;
  "is_archived"?: boolean;
  "ecom_seo_data"?: CatalogEcomSeoData;
  "food_and_beverage_details"?: CatalogItemFoodAndBeverageDetails;
  "reporting_category"?: CatalogObjectCategory;
  "is_alcoholic"?: boolean;
};

/** The food and beverage-specific details of a `FOOD_AND_BEV` item. */
export type CatalogItemFoodAndBeverageDetails = {
  "calorie_count"?: number;
  "dietary_preferences"?: Array<CatalogItemFoodAndBeverageDetailsDietaryPreference>;
  "ingredients"?: Array<CatalogItemFoodAndBeverageDetailsIngredient>;
};

/** Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients. */
export type CatalogItemFoodAndBeverageDetailsDietaryPreference = {
  "type"?: CatalogItemFoodAndBeverageDetailsDietaryPreferenceType;
  "standard_name"?: CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference;
  "custom_name"?: string;
};

/** Standard dietary preferences for food and beverage items that are recommended on item creation. */
export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "DAIRY_FREE" | "GLUTEN_FREE" | "HALAL" | "KOSHER" | "NUT_FREE" | "VEGAN" | "VEGETARIAN";

/** The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. */
export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = "STANDARD" | "CUSTOM";

/** Describes the ingredient used in a `FOOD_AND_BEV` item. */
export type CatalogItemFoodAndBeverageDetailsIngredient = {
  "type"?: CatalogItemFoodAndBeverageDetailsDietaryPreferenceType;
  "standard_name"?: CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient;
  "custom_name"?: string;
};

/** Standard ingredients for food and beverage items that are recommended on item creation. */
export type CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "CELERY" | "CRUSTACEANS" | "EGGS" | "FISH" | "GLUTEN" | "LUPIN" | "MILK" | "MOLLUSCS" | "MUSTARD" | "PEANUTS" | "SESAME" | "SOY" | "SULPHITES" | "TREE_NUTS";

/** Controls how a modifier list is applied to a specific item. This object allows for item-specific customization of modifier list behavior
and provides the ability to override global modifier list settings. */
export type CatalogItemModifierListInfo = {
  "modifier_list_id": string;
  "modifier_overrides"?: Array<CatalogModifierOverride>;
  "min_selected_modifiers"?: number;
  "max_selected_modifiers"?: number;
  "enabled"?: boolean;
  "ordinal"?: number;
  "allow_quantities"?: CatalogModifierToggleOverrideType;
  "is_conversational"?: CatalogModifierToggleOverrideType;
  "hidden_from_customer_override"?: CatalogModifierToggleOverrideType;
};

/** A group of variations for a `CatalogItem`. */
export type CatalogItemOption = {
  "name"?: string;
  "display_name"?: string;
  "description"?: string;
  "show_colors"?: boolean;
  "values"?: Array<CatalogObject>;
};

/**  An option that can be assigned to an item.
For example, a t-shirt item may offer a color option or a size option. */
export type CatalogItemOptionForItem = {
  "item_option_id"?: string;
};

/** An enumerated value that can link a
`CatalogItemVariation` to an item option as one of
its item option values. */
export type CatalogItemOptionValue = {
  "item_option_id"?: string;
  "name"?: string;
  "description"?: string;
  "color"?: string;
  "ordinal"?: number;
};

/** A `CatalogItemOptionValue` links an item variation to an item option as
an item option value. For example, a t-shirt item may offer a color option and
a size option. An item option value would represent each variation of t-shirt:
For example, "Color:Red, Size:Small" or "Color:Blue, Size:Medium". */
export type CatalogItemOptionValueForItemVariation = {
  "item_option_id"?: string;
  "item_option_value_id"?: string;
};

/** The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. */
export type CatalogItemProductType = "REGULAR" | "GIFT_CARD" | "APPOINTMENTS_SERVICE" | "FOOD_AND_BEV" | "EVENT" | "DIGITAL" | "DONATION" | "LEGACY_SQUARE_ONLINE_SERVICE" | "LEGACY_SQUARE_ONLINE_MEMBERSHIP";

/** An item variation, representing a product for sale, in the Catalog object model. Each [item](entity:CatalogItem) must have at least one
item variation and can have at most 250 item variations.

An item variation can be sellable, stockable, or both if it has a unit of measure for its count for the sold number of the variation, the stocked
number of the variation, or both. For example, when a variation representing wine is stocked and sold by the bottle, the variation is both
stockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot be used as a measure of the stocked units. This by-the-glass
variation is sellable, but not stockable. To accurately keep track of the wine's inventory count at any time, the sellable count must be
converted to stockable count. Typically, the seller defines this unit conversion. For example, 1 bottle equals 5 glasses. The Square API exposes
the `stockable_conversion` property on the variation to specify the conversion. Thus, when two glasses of the wine are sold, the sellable count
decreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the conversion. */
export type CatalogItemVariation = {
  "item_id"?: string;
  "name"?: string;
  "sku"?: string;
  "upc"?: string;
  "ordinal"?: number;
  "pricing_type"?: CatalogPricingType;
  "price_money"?: Money;
  "location_overrides"?: Array<ItemVariationLocationOverrides>;
  "track_inventory"?: boolean;
  "inventory_alert_type"?: InventoryAlertType;
  "inventory_alert_threshold"?: number;
  "user_data"?: string;
  "service_duration"?: number;
  "available_for_booking"?: boolean;
  "item_option_values"?: Array<CatalogItemOptionValueForItemVariation>;
  "measurement_unit_id"?: string;
  "sellable"?: boolean;
  "stockable"?: boolean;
  "image_ids"?: Array<string>;
  "team_member_ids"?: Array<string>;
  "stockable_conversion"?: CatalogStockConversion;
  "kitchen_name"?: string;
};

/** Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. */
export type CatalogMeasurementUnit = {
  "measurement_unit"?: MeasurementUnit;
  "precision"?: number;
};

/** A modifier that can be applied to items at the time of sale. For example, a cheese modifier for a burger, or a flavor modifier for a serving of ice cream. */
export type CatalogModifier = {
  "name"?: string;
  "price_money"?: Money;
  "on_by_default"?: boolean;
  "ordinal"?: number;
  "modifier_list_id"?: string;
  "location_overrides"?: Array<ModifierLocationOverrides>;
  "kitchen_name"?: string;
  "image_id"?: string;
  "hidden_online"?: boolean;
};

/** A container for a list of modifiers, or a text-based modifier.
For text-based modifiers, this represents text configuration for an item. (For example, custom text to print on a t-shirt).
For non text-based modifiers, this represents a list of modifiers that can be applied to items at the time of sale.
(For example, a list of condiments for a hot dog, or a list of ice cream flavors).
Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type. */
export type CatalogModifierList = {
  "name"?: string;
  "ordinal"?: number;
  "selection_type"?: CatalogModifierListSelectionType;
  "modifiers"?: Array<CatalogObject>;
  "image_ids"?: Array<string>;
  "allow_quantities"?: boolean;
  "is_conversational"?: boolean;
  "modifier_type"?: CatalogModifierListModifierType;
  "max_length"?: number;
  "text_required"?: boolean;
  "internal_name"?: string;
  "min_selected_modifiers"?: number;
  "max_selected_modifiers"?: number;
  "hidden_from_customer"?: boolean;
};

/** Defines the type of `CatalogModifierList`. */
export type CatalogModifierListModifierType = "LIST" | "TEXT";

/** Indicates whether a CatalogModifierList supports multiple selections. */
export type CatalogModifierListSelectionType = "SINGLE" | "MULTIPLE";

/** Options to control how to override the default behavior of the specified modifier. */
export type CatalogModifierOverride = {
  "modifier_id": string;
  "on_by_default"?: boolean;
  "hidden_online_override"?: CatalogModifierToggleOverrideType;
  "on_by_default_override"?: CatalogModifierToggleOverrideType;
};

/** Item level overrides for bool attributes */
export type CatalogModifierToggleOverrideType = "NO" | "YES" | "NOT_SET";

/** The wrapper object for the catalog entries of a given object type.

Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.

For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.

In general, if `type=<OBJECT_TYPE>`, the `CatalogObject` instance must have the `<OBJECT_TYPE>`-specific data set on the `<object_type>_data` attribute. The resulting `CatalogObject` instance is also a `Catalog<ObjectType>` instance.

For a more detailed discussion of the Catalog data model, please see the
[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. */
export type CatalogObject = {
  "type": CatalogObjectType;
  "id": string;
  "updated_at"?: string;
  "version"?: number;
  "is_deleted"?: boolean;
  "custom_attribute_values"?: Record<string, CatalogCustomAttributeValue>;
  "catalog_v1_ids"?: Array<CatalogV1Id>;
  "present_at_all_locations"?: boolean;
  "present_at_location_ids"?: Array<string>;
  "absent_at_location_ids"?: Array<string>;
  "item_data"?: CatalogItem;
  "category_data"?: CatalogCategory;
  "item_variation_data"?: CatalogItemVariation;
  "tax_data"?: CatalogTax;
  "discount_data"?: CatalogDiscount;
  "modifier_list_data"?: CatalogModifierList;
  "modifier_data"?: CatalogModifier;
  "time_period_data"?: CatalogTimePeriod;
  "product_set_data"?: CatalogProductSet;
  "pricing_rule_data"?: CatalogPricingRule;
  "image_data"?: CatalogImage;
  "measurement_unit_data"?: CatalogMeasurementUnit;
  "subscription_plan_data"?: CatalogSubscriptionPlan;
  "item_option_data"?: CatalogItemOption;
  "item_option_value_data"?: CatalogItemOptionValue;
  "custom_attribute_definition_data"?: CatalogCustomAttributeDefinition;
  "quick_amounts_settings_data"?: CatalogQuickAmountsSettings;
  "subscription_plan_variation_data"?: CatalogSubscriptionPlanVariation;
  "availability_period_data"?: CatalogAvailabilityPeriod;
};

/** A batch of catalog objects. */
export type CatalogObjectBatch = {
  "objects": Array<CatalogObject>;
};

/** A category that can be assigned to an item or a parent category that can be assigned 
to another category. For example, a clothing category can be assigned to a t-shirt item or 
be made as the parent category to the pants category. */
export type CatalogObjectCategory = {
  "id"?: string;
  "ordinal"?: number;
};

/** A reference to a Catalog object at a specific version. In general this is
used as an entry point into a graph of catalog objects, where the objects exist
at a specific version. */
export type CatalogObjectReference = {
  "object_id"?: string;
  "catalog_version"?: number;
};

/** Possible types of CatalogObjects returned from the catalog, each
containing type-specific properties in the `*_data` field corresponding to the specified object type. */
export type CatalogObjectType = "ITEM" | "IMAGE" | "CATEGORY" | "ITEM_VARIATION" | "TAX" | "DISCOUNT" | "MODIFIER_LIST" | "MODIFIER" | "PRICING_RULE" | "PRODUCT_SET" | "TIME_PERIOD" | "MEASUREMENT_UNIT" | "SUBSCRIPTION_PLAN_VARIATION" | "ITEM_OPTION" | "ITEM_OPTION_VAL" | "CUSTOM_ATTRIBUTE_DEFINITION" | "QUICK_AMOUNTS_SETTINGS" | "SUBSCRIPTION_PLAN" | "AVAILABILITY_PERIOD";

/** Defines how discounts are automatically applied to a set of items that match the pricing rule
during the active time period. */
export type CatalogPricingRule = {
  "name"?: string;
  "time_period_ids"?: Array<string>;
  "discount_id"?: string;
  "match_products_id"?: string;
  "apply_products_id"?: string;
  "exclude_products_id"?: string;
  "valid_from_date"?: string;
  "valid_from_local_time"?: string;
  "valid_until_date"?: string;
  "valid_until_local_time"?: string;
  "exclude_strategy"?: ExcludeStrategy;
  "minimum_order_subtotal_money"?: Money;
  "customer_group_ids_any"?: Array<string>;
};

/** Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. */
export type CatalogPricingType = "FIXED_PRICING" | "VARIABLE_PRICING";

/** Represents a collection of catalog objects for the purpose of applying a
`PricingRule`. Including a catalog object will include all of its subtypes.
For example, including a category in a product set will include all of its
items and associated item variations in the product set. Including an item in
a product set will also include its item variations. */
export type CatalogProductSet = {
  "name"?: string;
  "product_ids_any"?: Array<string>;
  "product_ids_all"?: Array<string>;
  "quantity_exact"?: number;
  "quantity_min"?: number;
  "quantity_max"?: number;
  "all_products"?: boolean;
};

/** A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint.

Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).
Any combination of the following types may be used together:
- [exact_query](entity:CatalogQueryExact)
- [prefix_query](entity:CatalogQueryPrefix)
- [range_query](entity:CatalogQueryRange)
- [sorted_attribute_query](entity:CatalogQuerySortedAttribute)
- [text_query](entity:CatalogQueryText)

All other query types cannot be combined with any others.

When a query filter is based on an attribute, the attribute must be searchable.
Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.

Searchable attribute and objects queryable by searchable attributes:
- `name`:  `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue`
- `description`: `CatalogItem`, `CatalogItemOptionValue`
- `abbreviation`: `CatalogItem`
- `upc`: `CatalogItemVariation`
- `sku`: `CatalogItemVariation`
- `caption`: `CatalogImage`
- `display_name`: `CatalogItemOption`

For example, to search for [CatalogItem](entity:CatalogItem) objects by searchable attributes, you can use
the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. */
export type CatalogQuery = {
  "sorted_attribute_query"?: CatalogQuerySortedAttribute;
  "exact_query"?: CatalogQueryExact;
  "set_query"?: CatalogQuerySet;
  "prefix_query"?: CatalogQueryPrefix;
  "range_query"?: CatalogQueryRange;
  "text_query"?: CatalogQueryText;
  "items_for_tax_query"?: CatalogQueryItemsForTax;
  "items_for_modifier_list_query"?: CatalogQueryItemsForModifierList;
  "items_for_item_options_query"?: CatalogQueryItemsForItemOptions;
  "item_variations_for_item_option_values_query"?: CatalogQueryItemVariationsForItemOptionValues;
};

/** The query filter to return the search result by exact match of the specified attribute name and value. */
export type CatalogQueryExact = {
  "attribute_name": string;
  "attribute_value": string;
};

/** The query filter to return the item variations containing the specified item option value IDs. */
export type CatalogQueryItemVariationsForItemOptionValues = {
  "item_option_value_ids"?: Array<string>;
};

/** The query filter to return the items containing the specified item option IDs. */
export type CatalogQueryItemsForItemOptions = {
  "item_option_ids"?: Array<string>;
};

/** The query filter to return the items containing the specified modifier list IDs. */
export type CatalogQueryItemsForModifierList = {
  "modifier_list_ids": Array<string>;
};

/** The query filter to return the items containing the specified tax IDs. */
export type CatalogQueryItemsForTax = {
  "tax_ids": Array<string>;
};

/** The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. */
export type CatalogQueryPrefix = {
  "attribute_name": string;
  "attribute_prefix": string;
};

/** The query filter to return the search result whose named attribute values fall between the specified range. */
export type CatalogQueryRange = {
  "attribute_name": string;
  "attribute_min_value"?: number;
  "attribute_max_value"?: number;
};

/** The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of
the `attribute_values`. */
export type CatalogQuerySet = {
  "attribute_name": string;
  "attribute_values": Array<string>;
};

/** The query expression to specify the key to sort search results. */
export type CatalogQuerySortedAttribute = {
  "attribute_name": string;
  "initial_attribute_value"?: string;
  "sort_order"?: SortOrder;
};

/** The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case. */
export type CatalogQueryText = {
  "keywords": Array<string>;
};

/** Represents a Quick Amount in the Catalog. */
export type CatalogQuickAmount = {
  "type": CatalogQuickAmountType;
  "amount": Money;
  "score"?: number;
  "ordinal"?: number;
};

/** Determines the type of a specific Quick Amount. */
export type CatalogQuickAmountType = "QUICK_AMOUNT_TYPE_MANUAL" | "QUICK_AMOUNT_TYPE_AUTO";

/** A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. */
export type CatalogQuickAmountsSettings = {
  "option": CatalogQuickAmountsSettingsOption;
  "eligible_for_auto_amounts"?: boolean;
  "amounts"?: Array<CatalogQuickAmount>;
};

/** Determines a seller's option on Quick Amounts feature. */
export type CatalogQuickAmountsSettingsOption = "DISABLED" | "MANUAL" | "AUTO";

/** Represents the rule of conversion between a stockable [CatalogItemVariation](entity:CatalogItemVariation)
and a non-stockable sell-by or receive-by `CatalogItemVariation` that
share the same underlying stock. */
export type CatalogStockConversion = {
  "stockable_item_variation_id": string;
  "stockable_quantity": string;
  "nonstockable_quantity": string;
};

/** Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations.
For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). */
export type CatalogSubscriptionPlan = {
  "name": string;
  "phases"?: Array<SubscriptionPhase>;
  "subscription_plan_variations"?: Array<CatalogObject>;
  "eligible_item_ids"?: Array<string>;
  "eligible_category_ids"?: Array<string>;
  "all_items"?: boolean;
};

/** Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold.
For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). */
export type CatalogSubscriptionPlanVariation = {
  "name": string;
  "phases": Array<SubscriptionPhase>;
  "subscription_plan_id"?: string;
  "monthly_billing_anchor_date"?: number;
  "can_prorate"?: boolean;
  "successor_plan_variation_id"?: string;
};

/** A tax applicable to an item. */
export type CatalogTax = {
  "name"?: string;
  "calculation_phase"?: TaxCalculationPhase;
  "inclusion_type"?: TaxInclusionType;
  "percentage"?: string;
  "applies_to_custom_amounts"?: boolean;
  "enabled"?: boolean;
  "applies_to_product_set_id"?: string;
};

/** Represents a time period - either a single period or a repeating period. */
export type CatalogTimePeriod = {
  "event"?: string;
};

/** A Square API V1 identifier of an item, including the object ID and its associated location ID. */
export type CatalogV1Id = {
  "catalog_v1_id"?: string;
  "location_id"?: string;
};

/** Published when the catalog is updated. */
export type CatalogVersionUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CatalogVersionUpdatedEventData;
};

export type CatalogVersionUpdatedEventCatalogVersion = {
  "updated_at"?: string;
};

export type CatalogVersionUpdatedEventData = {
  "type"?: string;
  "object"?: CatalogVersionUpdatedEventObject;
};

export type CatalogVersionUpdatedEventObject = {
  "catalog_version"?: CatalogVersionUpdatedEventCatalogVersion;
};

/** A node in the path from a retrieved category to its root node. */
export type CategoryPathToRootNode = {
  "category_id"?: string;
  "category_name"?: string;
};

/** Defines input parameters in a request to the
[ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint. */
export type ChangeBillingAnchorDateRequest = {
  "monthly_billing_anchor_date"?: number;
  "effective_date"?: string;
};

/** Defines output parameters in a request to the
[ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint. */
export type ChangeBillingAnchorDateResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
  "actions"?: Array<SubscriptionAction>;
};

/** Supported timings when a pending change, as an action, takes place to a subscription. */
export type ChangeTiming = "IMMEDIATE" | "END_OF_BILLING_CYCLE";

export type Channel = {
  "id"?: string;
  "merchant_id"?: string;
  "name"?: string;
  "version"?: number;
  "reference"?: Reference;
  "status"?: ChannelStatus;
  "created_at"?: string;
  "updated_at"?: string;
};

export type ChannelStatus = "ACTIVE" | "INACTIVE";

/** Represents an additional recipient (other than the merchant) entitled to a portion of the tender.
Support is currently limited to USD, CAD and GBP currencies */
export type ChargeRequestAdditionalRecipient = {
  "location_id": string;
  "description": string;
  "amount_money": Money;
};

/** Square Checkout lets merchants accept online payments for supported
payment types using a checkout workflow hosted on squareup.com. */
export type Checkout = {
  "id"?: string;
  "checkout_page_url"?: string;
  "ask_for_shipping_address"?: boolean;
  "merchant_support_email"?: string;
  "pre_populate_buyer_email"?: string;
  "pre_populate_shipping_address"?: Address;
  "redirect_url"?: string;
  "order"?: Order;
  "created_at"?: string;
  "additional_recipients"?: Array<AdditionalRecipient>;
};

export type CheckoutLocationSettings = {
  "location_id"?: string;
  "customer_notes_enabled"?: boolean;
  "policies"?: Array<CheckoutLocationSettingsPolicy>;
  "branding"?: CheckoutLocationSettingsBranding;
  "tipping"?: CheckoutLocationSettingsTipping;
  "coupons"?: CheckoutLocationSettingsCoupons;
  "updated_at"?: string;
};

export type CheckoutLocationSettingsBranding = {
  "header_type"?: CheckoutLocationSettingsBrandingHeaderType;
  "button_color"?: string;
  "button_shape"?: CheckoutLocationSettingsBrandingButtonShape;
};

export type CheckoutLocationSettingsBrandingButtonShape = "SQUARED" | "ROUNDED" | "PILL";

export type CheckoutLocationSettingsBrandingHeaderType = "BUSINESS_NAME" | "FRAMED_LOGO" | "FULL_WIDTH_LOGO";

export type CheckoutLocationSettingsCoupons = {
  "enabled"?: boolean;
};

export type CheckoutLocationSettingsPolicy = {
  "uid"?: string;
  "title"?: string;
  "description"?: string;
};

export type CheckoutLocationSettingsTipping = {
  "percentages"?: Array<number>;
  "smart_tipping_enabled"?: boolean;
  "default_percent"?: number;
  "smart_tips"?: Array<Money>;
  "default_smart_tip"?: Money;
};

export type CheckoutMerchantSettings = {
  "payment_methods"?: CheckoutMerchantSettingsPaymentMethods;
  "updated_at"?: string;
};

export type CheckoutMerchantSettingsPaymentMethods = {
  "apple_pay"?: CheckoutMerchantSettingsPaymentMethodsPaymentMethod;
  "google_pay"?: CheckoutMerchantSettingsPaymentMethodsPaymentMethod;
  "cash_app"?: CheckoutMerchantSettingsPaymentMethodsPaymentMethod;
  "afterpay_clearpay"?: CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay;
};

/** The settings allowed for AfterpayClearpay. */
export type CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay = {
  "order_eligibility_range"?: CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange;
  "item_eligibility_range"?: CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange;
  "enabled"?: boolean;
};

/** A range of purchase price that qualifies. */
export type CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange = {
  "min": Money;
  "max": Money;
};

/** The settings allowed for a payment method. */
export type CheckoutMerchantSettingsPaymentMethodsPaymentMethod = {
  "enabled"?: boolean;
};

export type CheckoutOptions = {
  "allow_tipping"?: boolean;
  "custom_fields"?: Array<CustomField>;
  "subscription_plan_id"?: string;
  "redirect_url"?: string;
  "merchant_support_email"?: string;
  "ask_for_shipping_address"?: boolean;
  "accepted_payment_methods"?: AcceptedPaymentMethods;
  "app_fee_money"?: Money;
  "shipping_fee"?: ShippingFee;
  "enable_coupon"?: boolean;
  "enable_loyalty"?: boolean;
};

export type CheckoutOptionsPaymentType = "CARD_PRESENT" | "MANUAL_CARD_ENTRY" | "FELICA_ID" | "FELICA_QUICPAY" | "FELICA_TRANSPORTATION_GROUP" | "FELICA_ALL" | "PAYPAY" | "QR_CODE";

/** Additional details about Clearpay payments. */
export type ClearpayDetails = {
  "email_address"?: string;
};

/** Defines the fields that are included in requests to the
[CloneOrder](api-endpoint:Orders-CloneOrder) endpoint. */
export type CloneOrderRequest = {
  "order_id": string;
  "version"?: number;
  "idempotency_key"?: string;
};

/** Defines the fields that are included in the response body of
a request to the [CloneOrder](api-endpoint:Orders-CloneOrder) endpoint. */
export type CloneOrderResponse = {
  "order"?: Order;
  "errors"?: Array<Error>;
};

export type CollectedData = {
  "input_text"?: string;
};

/** Describes a request to complete (capture) a payment using
[CompletePayment](api-endpoint:Payments-CompletePayment).

By default, payments are set to `autocomplete` immediately after they are created.
To complete payments manually, set `autocomplete` to `false`. */
export type CompletePaymentRequest = {
  "version_token"?: string;
};

/** Defines the response returned by[CompletePayment](api-endpoint:Payments-CompletePayment). */
export type CompletePaymentResponse = {
  "errors"?: Array<Error>;
  "payment"?: Payment;
};

/** The wrapper object for the component entries of a given component type. */
export type Component = {
  "type": ComponentComponentType;
  "application_details"?: DeviceComponentDetailsApplicationDetails;
  "card_reader_details"?: DeviceComponentDetailsCardReaderDetails;
  "battery_details"?: DeviceComponentDetailsBatteryDetails;
  "wifi_details"?: DeviceComponentDetailsWiFiDetails;
  "ethernet_details"?: DeviceComponentDetailsEthernetDetails;
};

/** An enum for ComponentType. */
export type ComponentComponentType = "APPLICATION" | "CARD_READER" | "BATTERY" | "WIFI" | "ETHERNET" | "PRINTER";

export type ConfirmationDecision = {
  "has_agreed"?: boolean;
};

export type ConfirmationOptions = {
  "title": string;
  "body": string;
  "agree_button_text": string;
  "disagree_button_text"?: string;
  "decision"?: ConfirmationDecision;
};

/** Latitude and longitude coordinates. */
export type Coordinates = {
  "latitude"?: number;
  "longitude"?: number;
};

/** Indicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). */
export type Country = "ZZ" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";

/** Request object for linking a bank account to a Square account */
export type CreateBankAccountRequest = {
  "idempotency_key": string;
  "source_id": string;
  "customer_id"?: string;
};

/** Response object returned by CreateBankAccount. */
export type CreateBankAccountResponse = {
  "bank_account"?: BankAccount;
  "errors"?: Array<Error>;
};

/** Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) request. */
export type CreateBookingCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type CreateBookingCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

export type CreateBookingRequest = {
  "idempotency_key"?: string;
  "booking": Booking;
};

export type CreateBookingResponse = {
  "booking"?: Booking;
  "errors"?: Array<Error>;
};

/** A request to create a new `BreakType`. */
export type CreateBreakTypeRequest = {
  "idempotency_key"?: string;
  "break_type": BreakType;
};

/** The response to the request to create a `BreakType`. The response contains
the created `BreakType` object and might contain a set of `Error` objects if
the request resulted in errors. */
export type CreateBreakTypeResponse = {
  "break_type"?: BreakType;
  "errors"?: Array<Error>;
};

/** Creates a card from the source (payment token or payment id). Accessible via
HTTP requests at POST https://connect.squareup.com/v2/cards */
export type CreateCardRequest = {
  "idempotency_key": string;
  "source_id": string;
  "verification_token"?: string;
  "card": Card;
};

/** Defines the fields that are included in the response body of
a request to the [CreateCard](api-endpoint:Cards-CreateCard) endpoint.

Note: if there are errors processing the request, the card field will not be
present. */
export type CreateCardResponse = {
  "errors"?: Array<Error>;
  "card"?: Card;
};

export type CreateCatalogImageRequest = {
  "idempotency_key": string;
  "object_id"?: string;
  "image": CatalogObject;
  "is_primary"?: boolean;
};

export type CreateCatalogImageResponse = {
  "errors"?: Array<Error>;
  "image"?: CatalogObject;
};

/** Defines the parameters that can be included in the body of
a request to the `CreateCheckout` endpoint. */
export type CreateCheckoutRequest = {
  "idempotency_key": string;
  "order": CreateOrderRequest;
  "ask_for_shipping_address"?: boolean;
  "merchant_support_email"?: string;
  "pre_populate_buyer_email"?: string;
  "pre_populate_shipping_address"?: Address;
  "redirect_url"?: string;
  "additional_recipients"?: Array<ChargeRequestAdditionalRecipient>;
  "note"?: string;
};

/** Defines the fields that are included in the response body of
a request to the `CreateCheckout` endpoint. */
export type CreateCheckoutResponse = {
  "checkout"?: Checkout;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the request body of a request
to the `CreateCustomerCard` endpoint. */
export type CreateCustomerCardRequest = {
  "card_nonce": string;
  "billing_address"?: Address;
  "cardholder_name"?: string;
  "verification_token"?: string;
};

/** 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). */
export type CreateCustomerCardResponse = {
  "errors"?: Array<Error>;
  "card"?: Card;
};

/** Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) request. */
export type CreateCustomerCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type CreateCustomerCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Defines the body parameters that can be included in a request to the
[CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) endpoint. */
export type CreateCustomerGroupRequest = {
  "idempotency_key"?: string;
  "group": CustomerGroup;
};

/** Defines the fields that are included in the response body of
a request to the [CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) endpoint.

Either `errors` or `group` is present in a given response (never both). */
export type CreateCustomerGroupResponse = {
  "errors"?: Array<Error>;
  "group"?: CustomerGroup;
};

/** Defines the body parameters that can be included in a request to the
`CreateCustomer` endpoint. */
export type CreateCustomerRequest = {
  "idempotency_key"?: string;
  "given_name"?: string;
  "family_name"?: string;
  "company_name"?: string;
  "nickname"?: string;
  "email_address"?: string;
  "address"?: Address;
  "phone_number"?: string;
  "reference_id"?: string;
  "note"?: string;
  "birthday"?: string;
  "tax_ids"?: CustomerTaxIds;
};

/** Defines the fields that are included in the response body of
a request to the [CreateCustomer](api-endpoint:Customers-CreateCustomer) or
[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.

Either `errors` or `customer` is present in a given response (never both). */
export type CreateCustomerResponse = {
  "errors"?: Array<Error>;
  "customer"?: Customer;
};

export type CreateDeviceCodeRequest = {
  "idempotency_key": string;
  "device_code": DeviceCode;
};

export type CreateDeviceCodeResponse = {
  "errors"?: Array<Error>;
  "device_code"?: DeviceCode;
};

/** Defines the parameters for a `CreateDisputeEvidenceFile` request. */
export type CreateDisputeEvidenceFileRequest = {
  "idempotency_key": string;
  "evidence_type"?: DisputeEvidenceType;
  "content_type"?: string;
};

/** Defines the fields in a `CreateDisputeEvidenceFile` response. */
export type CreateDisputeEvidenceFileResponse = {
  "errors"?: Array<Error>;
  "evidence"?: DisputeEvidence;
};

/** Defines the parameters for a `CreateDisputeEvidenceText` request. */
export type CreateDisputeEvidenceTextRequest = {
  "idempotency_key": string;
  "evidence_type"?: DisputeEvidenceType;
  "evidence_text": string;
};

/** Defines the fields in a `CreateDisputeEvidenceText` response. */
export type CreateDisputeEvidenceTextResponse = {
  "errors"?: Array<Error>;
  "evidence"?: DisputeEvidence;
};

/** A request to create a gift card activity. */
export type CreateGiftCardActivityRequest = {
  "idempotency_key": string;
  "gift_card_activity": GiftCardActivity;
};

/** A response that contains a `GiftCardActivity` that was created.
The response might contain a set of `Error` objects if the request resulted in errors. */
export type CreateGiftCardActivityResponse = {
  "errors"?: Array<Error>;
  "gift_card_activity"?: GiftCardActivity;
};

/** Represents a [CreateGiftCard](api-endpoint:GiftCards-CreateGiftCard) request. */
export type CreateGiftCardRequest = {
  "idempotency_key": string;
  "location_id": string;
  "gift_card": GiftCard;
};

/** A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request
resulted in errors. */
export type CreateGiftCardResponse = {
  "errors"?: Array<Error>;
  "gift_card"?: GiftCard;
};

/** Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) request. */
export type CreateInvoiceAttachmentRequest = {
  "idempotency_key"?: string;
  "description"?: string;
};

/** Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) response. */
export type CreateInvoiceAttachmentResponse = {
  "attachment"?: InvoiceAttachment;
  "errors"?: Array<Error>;
};

/** Describes a `CreateInvoice` request. */
export type CreateInvoiceRequest = {
  "invoice": Invoice;
  "idempotency_key"?: string;
};

/** The response returned by the `CreateInvoice` request. */
export type CreateInvoiceResponse = {
  "invoice"?: Invoice;
  "errors"?: Array<Error>;
};

/** Represents a [CreateJob](api-endpoint:Team-CreateJob) request. */
export type CreateJobRequest = {
  "job": Job;
  "idempotency_key": string;
};

/** Represents a [CreateJob](api-endpoint:Team-CreateJob) response. Either `job` or `errors`
is present in the response. */
export type CreateJobResponse = {
  "job"?: Job;
  "errors"?: Array<Error>;
};

/** Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) request. */
export type CreateLocationCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type CreateLocationCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** The request object for the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint. */
export type CreateLocationRequest = {
  "location"?: Location;
};

/** The response object returned by the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint. */
export type CreateLocationResponse = {
  "errors"?: Array<Error>;
  "location"?: Location;
};

/** A request to create a new loyalty account. */
export type CreateLoyaltyAccountRequest = {
  "loyalty_account": LoyaltyAccount;
  "idempotency_key": string;
};

/** A response that includes loyalty account created. */
export type CreateLoyaltyAccountResponse = {
  "errors"?: Array<Error>;
  "loyalty_account"?: LoyaltyAccount;
};

/** Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) request. */
export type CreateLoyaltyPromotionRequest = {
  "loyalty_promotion": LoyaltyPromotion;
  "idempotency_key": string;
};

/** Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) response.
Either `loyalty_promotion` or `errors` is present in the response. */
export type CreateLoyaltyPromotionResponse = {
  "errors"?: Array<Error>;
  "loyalty_promotion"?: LoyaltyPromotion;
};

/** A request to create a loyalty reward. */
export type CreateLoyaltyRewardRequest = {
  "reward": LoyaltyReward;
  "idempotency_key": string;
};

/** A response that includes the loyalty reward created. */
export type CreateLoyaltyRewardResponse = {
  "errors"?: Array<Error>;
  "reward"?: LoyaltyReward;
};

/** Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) request. */
export type CreateMerchantCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type CreateMerchantCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Represents a create request for an order custom attribute definition. */
export type CreateOrderCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents a response from creating an order custom attribute definition. */
export type CreateOrderCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

export type CreateOrderRequest = {
  "order"?: Order;
  "idempotency_key"?: string;
};

/** 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. */
export type CreateOrderResponse = {
  "order"?: Order;
  "errors"?: Array<Error>;
};

export type CreatePaymentLinkRequest = {
  "idempotency_key"?: string;
  "description"?: string;
  "quick_pay"?: QuickPay;
  "order"?: Order;
  "checkout_options"?: CheckoutOptions;
  "pre_populated_data"?: PrePopulatedData;
  "payment_note"?: string;
};

export type CreatePaymentLinkResponse = {
  "errors"?: Array<Error>;
  "payment_link"?: PaymentLink;
  "related_resources"?: PaymentLinkRelatedResources;
};

/** Describes a request to create a payment using
[CreatePayment](api-endpoint:Payments-CreatePayment). */
export type CreatePaymentRequest = {
  "source_id": string;
  "idempotency_key": string;
  "amount_money"?: Money;
  "tip_money"?: Money;
  "app_fee_money"?: Money;
  "app_fee_allocations"?: Array<AppFeeAllocation>;
  "delay_duration"?: string;
  "delay_action"?: string;
  "autocomplete"?: boolean;
  "order_id"?: string;
  "customer_id"?: string;
  "location_id"?: string;
  "team_member_id"?: string;
  "reference_id"?: string;
  "verification_token"?: string;
  "accept_partial_authorization"?: boolean;
  "buyer_email_address"?: string;
  "buyer_phone_number"?: string;
  "billing_address"?: Address;
  "shipping_address"?: Address;
  "note"?: string;
  "statement_description_identifier"?: string;
  "cash_details"?: CashPaymentDetails;
  "external_details"?: ExternalPaymentDetails;
  "customer_details"?: CustomerDetails;
  "offline_payment_details"?: OfflinePaymentDetails;
};

/** Defines the response returned by [CreatePayment](api-endpoint:Payments-CreatePayment).

If there are errors processing the request, the `payment` field might not be
present, or it might be present with a status of `FAILED`. */
export type CreatePaymentResponse = {
  "errors"?: Array<Error>;
  "payment"?: Payment;
};

/** Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) request. */
export type CreateScheduledShiftRequest = {
  "idempotency_key"?: string;
  "scheduled_shift": ScheduledShift;
};

/** Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) response.
Either `scheduled_shift` or `errors` is present in the response. */
export type CreateScheduledShiftResponse = {
  "scheduled_shift"?: ScheduledShift;
  "errors"?: Array<Error>;
};

/** Represents a request to create a `Shift`. */
export type CreateShiftRequest = {
  "idempotency_key"?: string;
  "shift": Shift;
};

/** The response to a request to create a `Shift`. The response contains
the created `Shift` object and might contain a set of `Error` objects if
the request resulted in errors. */
export type CreateShiftResponse = {
  "shift"?: Shift;
  "errors"?: Array<Error>;
};

/** Defines input parameters in a request to the 
[CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) endpoint. */
export type CreateSubscriptionRequest = {
  "idempotency_key"?: string;
  "location_id": string;
  "plan_variation_id"?: string;
  "customer_id": string;
  "start_date"?: string;
  "canceled_date"?: string;
  "tax_percentage"?: string;
  "price_override_money"?: Money;
  "card_id"?: string;
  "timezone"?: string;
  "source"?: SubscriptionSource;
  "monthly_billing_anchor_date"?: number;
  "phases"?: Array<Phase>;
};

/** Defines output parameters in a response from the
[CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) endpoint. */
export type CreateSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
};

/** Represents a create request for a `TeamMember` object. */
export type CreateTeamMemberRequest = {
  "idempotency_key"?: string;
  "team_member"?: TeamMember;
};

/** Represents a response from a create request containing the created `TeamMember` object or error messages. */
export type CreateTeamMemberResponse = {
  "team_member"?: TeamMember;
  "errors"?: Array<Error>;
};

export type CreateTerminalActionRequest = {
  "idempotency_key": string;
  "action": TerminalAction;
};

export type CreateTerminalActionResponse = {
  "errors"?: Array<Error>;
  "action"?: TerminalAction;
};

export type CreateTerminalCheckoutRequest = {
  "idempotency_key": string;
  "checkout": TerminalCheckout;
};

export type CreateTerminalCheckoutResponse = {
  "errors"?: Array<Error>;
  "checkout"?: TerminalCheckout;
};

export type CreateTerminalRefundRequest = {
  "idempotency_key": string;
  "refund"?: TerminalRefund;
};

export type CreateTerminalRefundResponse = {
  "errors"?: Array<Error>;
  "refund"?: TerminalRefund;
};

/** Represents a request to create a `Timecard`. */
export type CreateTimecardRequest = {
  "idempotency_key"?: string;
  "timecard": Timecard;
};

/** The response to a request to create a `Timecard`. The response contains
the created `Timecard` object and might contain a set of `Error` objects if
the request resulted in errors. */
export type CreateTimecardResponse = {
  "timecard"?: Timecard;
  "errors"?: Array<Error>;
};

/** Data for creating a new transfer order to move [CatalogItemVariation](entity:CatalogItemVariation)s
between [Location](entity:Location)s. Used with the [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder)
endpoint. */
export type CreateTransferOrderData = {
  "source_location_id": string;
  "destination_location_id": string;
  "expected_at"?: string;
  "notes"?: string;
  "tracking_number"?: string;
  "created_by_team_member_id"?: string;
  "line_items"?: Array<CreateTransferOrderLineData>;
};

/** Data for creating a new transfer order line item. Each line item specifies a 
[CatalogItemVariation](entity:CatalogItemVariation) and quantity to transfer. */
export type CreateTransferOrderLineData = {
  "item_variation_id": string;
  "quantity_ordered": string;
};

/** Request to create a new transfer order. */
export type CreateTransferOrderRequest = {
  "idempotency_key": string;
  "transfer_order": CreateTransferOrderData;
};

/** Response for creating a transfer order. */
export type CreateTransferOrderResponse = {
  "transfer_order"?: TransferOrder;
  "errors"?: Array<Error>;
};

/** Represents an input to a call to [CreateVendor](api-endpoint:Vendors-CreateVendor). */
export type CreateVendorRequest = {
  "idempotency_key": string;
  "vendor"?: Vendor;
};

/** Represents an output from a call to [CreateVendor](api-endpoint:Vendors-CreateVendor). */
export type CreateVendorResponse = {
  "errors"?: Array<Error>;
  "vendor"?: Vendor;
};

/** Creates a [Subscription](entity:WebhookSubscription). */
export type CreateWebhookSubscriptionRequest = {
  "idempotency_key"?: string;
  "subscription": WebhookSubscription;
};

/** Defines the fields that are included in the response body of
a request to the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) endpoint.

Note: if there are errors processing the request, the [Subscription](entity:WebhookSubscription) will not be
present. */
export type CreateWebhookSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: WebhookSubscription;
};

/** Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). */
export type Currency = "UNKNOWN_CURRENCY" | "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYR" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SLE" | "SOS" | "SRD" | "SSP" | "STD" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "USS" | "UYI" | "UYU" | "UZS" | "VEF" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "XTS" | "XXX" | "YER" | "ZAR" | "ZMK" | "ZMW" | "BTC" | "XUS";

/** A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. */
export type CustomAttribute = {
  "key"?: string;
  "value"?: Record<string, unknown>;
  "version"?: number;
  "visibility"?: CustomAttributeDefinitionVisibility;
  "definition"?: CustomAttributeDefinition;
  "updated_at"?: string;
  "created_at"?: string;
};

/** Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. */
export type CustomAttributeDefinition = {
  "key"?: string;
  "schema"?: Record<string, unknown>;
  "name"?: string;
  "description"?: string;
  "visibility"?: CustomAttributeDefinitionVisibility;
  "version"?: number;
  "updated_at"?: string;
  "created_at"?: string;
};

/** Represents an object in the CustomAttributeDefinition event notification
payload that contains the affected custom attribute definition. */
export type CustomAttributeDefinitionEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CustomAttributeDefinitionEventDataObject;
};

export type CustomAttributeDefinitionEventDataObject = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
};

/** 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. */
export type CustomAttributeDefinitionVisibility = "VISIBILITY_HIDDEN" | "VISIBILITY_READ_ONLY" | "VISIBILITY_READ_WRITE_VALUES";

export type CustomAttributeEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CustomAttributeEventDataObject;
};

export type CustomAttributeEventDataObject = {
  "custom_attribute"?: CustomAttribute;
};

/** Supported custom attribute query expressions for calling the
[SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems)
endpoint to search for items or item variations. */
export type CustomAttributeFilter = {
  "custom_attribute_definition_id"?: string;
  "key"?: string;
  "string_filter"?: string;
  "number_filter"?: Range;
  "selection_uids_filter"?: Array<string>;
  "bool_filter"?: boolean;
};

/** Describes a custom form field to add to the checkout page to collect more information from buyers during checkout.
For more information,
see [Specify checkout options](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#specify-checkout-options-1). */
export type CustomField = {
  "title": string;
};

/** Represents a Square customer profile in the Customer Directory of a Square seller. */
export type Customer = {
  "id"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "given_name"?: string;
  "family_name"?: string;
  "nickname"?: string;
  "company_name"?: string;
  "email_address"?: string;
  "address"?: Address;
  "phone_number"?: string;
  "birthday"?: string;
  "reference_id"?: string;
  "note"?: string;
  "preferences"?: CustomerPreferences;
  "creation_source"?: CustomerCreationSource;
  "group_ids"?: Array<string>;
  "segment_ids"?: Array<string>;
  "version"?: number;
  "tax_ids"?: CustomerTaxIds;
};

/** The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) filter when
searching by an `Address`-type custom attribute. */
export type CustomerAddressFilter = {
  "postal_code"?: CustomerTextFilter;
  "country"?: Country;
};

/** Published when a [customer](entity:Customer) is created. Subscribe to this event to track customer profiles affected by a merge operation.
For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).

The `customer` object in the event notification does not include the `segment_ids` field. */
export type CustomerCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomerCreatedEventData;
};

/** The data associated with the event. */
export type CustomerCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CustomerCreatedEventObject;
};

/** Information about the change that triggered the event. */
export type CustomerCreatedEventEventContext = {
  "merge"?: CustomerCreatedEventEventContextMerge;
};

/** Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers. */
export type CustomerCreatedEventEventContextMerge = {
  "from_customer_ids"?: Array<string>;
  "to_customer_id"?: string;
};

/** An object that contains the customer associated with the event. */
export type CustomerCreatedEventObject = {
  "customer"?: Customer;
  "event_context"?: CustomerCreatedEventEventContext;
};

/** Indicates the method used to create the customer profile. */
export type CustomerCreationSource = "OTHER" | "APPOINTMENTS" | "COUPON" | "DELETION_RECOVERY" | "DIRECTORY" | "EGIFTING" | "EMAIL_COLLECTION" | "FEEDBACK" | "IMPORT" | "INVOICES" | "LOYALTY" | "MARKETING" | "MERGE" | "ONLINE_STORE" | "INSTANT_PROFILE" | "TERMINAL" | "THIRD_PARTY" | "THIRD_PARTY_IMPORT" | "UNMERGE_RECOVERY";

/** 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. */
export type CustomerCreationSourceFilter = {
  "values"?: Array<CustomerCreationSource>;
  "rule"?: CustomerInclusionExclusion;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) 
is created by the subscribing application.

This event is replaced by 
[customer.custom_attribute_definition.owned.created](webhook:customer.custom_attribute_definition.owned.created). */
export type CustomerCustomAttributeDefinitionCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to all applications is created. A notification is sent when any application creates a custom
attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.

This event is replaced by 
[customer.custom_attribute_definition.visible.created](webhook:customer.custom_attribute_definition.visible.created),
which applies to custom attribute definitions that are visible to the subscribing application. */
export type CustomerCustomAttributeDefinitionCreatedPublicEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
created by the subscribing application is deleted. A custom attribute definition can only be deleted by
the application that created it.

This event is replaced by 
[customer.custom_attribute_definition.owned.deleted](webhook:customer.custom_attribute_definition.owned.deleted). */
export type CustomerCustomAttributeDefinitionDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to all applications is deleted. A notification is sent when any application deletes a custom
attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.

This event is replaced by 
[customer.custom_attribute_definition.visible.deleted](webhook:customer.custom_attribute_definition.visible.deleted),
which applies to custom attribute definitions that are visible to the subscribing application. */
export type CustomerCustomAttributeDefinitionDeletedPublicEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) 
is created by the subscribing application. */
export type CustomerCustomAttributeDefinitionOwnedCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
created by the subscribing application is deleted. A custom attribute definition can only be deleted by
the application that created it. */
export type CustomerCustomAttributeDefinitionOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
created by the subscribing application is updated. A custom attribute definition can only be updated by
the application that created it. */
export type CustomerCustomAttributeDefinitionOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
created by the subscribing application is updated. A custom attribute definition can only be updated by
the application that created it.

This event is replaced by 
[customer.custom_attribute_definition.owned.updated](webhook:customer.custom_attribute_definition.owned.updated). */
export type CustomerCustomAttributeDefinitionUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to all applications is updated. A notification is sent when any application updates a custom
attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.

This event is replaced by 
[customer.custom_attribute_definition.visible.updated](webhook:customer.custom_attribute_definition.visible.updated),
which applies to custom attribute definitions that are visible to the subscribing application. */
export type CustomerCustomAttributeDefinitionUpdatedPublicEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to the subscribing application is created. A notification is sent when your application
creates a custom attribute definition or another application creates a custom attribute definition whose
`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type CustomerCustomAttributeDefinitionVisibleCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to the subscribing application is deleted. A custom attribute definition can only be deleted
by the application that created it. A notification is sent when your application deletes a custom attribute
definition or when another application deletes a custom attribute definition whose `visibility` is
`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type CustomerCustomAttributeDefinitionVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to the subscribing application is updated. A custom attribute definition can only be updated
by the application that created it. A notification is sent when your application updates a custom
attribute definition or when another application updates a custom attribute definition whose `visibility` is
`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type CustomerCustomAttributeDefinitionVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a customer [custom attribute](entity:CustomAttribute) owned by the
subscribing application is deleted. Custom attributes are owned by the application that created the
corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose
`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application.

This event is replaced by 
[customer.custom_attribute.owned.deleted](webhook:customer.custom_attribute.owned.deleted). */
export type CustomerCustomAttributeDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a customer [custom attribute](entity:CustomAttribute) that is visible
to all applications is deleted. A notification is sent when any application deletes a custom attribute
whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.

This event is replaced by 
[customer.custom_attribute.visible.deleted](webhook:customer.custom_attribute.visible.deleted),
which applies to custom attributes that are visible to the subscribing application. */
export type CustomerCustomAttributeDeletedPublicEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** The custom attribute filter. Use this filter in a set of [custom attribute filters](entity:CustomerCustomAttributeFilters) to search
based on the value or last updated date of a customer-related [custom attribute](entity:CustomAttribute). */
export type CustomerCustomAttributeFilter = {
  "key": string;
  "filter"?: CustomerCustomAttributeFilterValue;
  "updated_at"?: TimeRange;
};

/** A type-specific filter used in a [custom attribute filter](entity:CustomerCustomAttributeFilter) to search based on the value 
of a customer-related [custom attribute](entity:CustomAttribute). */
export type CustomerCustomAttributeFilterValue = {
  "email"?: CustomerTextFilter;
  "phone"?: CustomerTextFilter;
  "text"?: CustomerTextFilter;
  "selection"?: FilterValue;
  "date"?: TimeRange;
  "number"?: FloatNumberRange;
  "boolean"?: boolean;
  "address"?: CustomerAddressFilter;
};

/** The custom attribute filters in a set of [customer filters](entity:CustomerFilter) used in a search query. Use this filter
to search based on [custom attributes](entity: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). */
export type CustomerCustomAttributeFilters = {
  "filters"?: Array<CustomerCustomAttributeFilter>;
};

/** Published when a customer [custom attribute](entity:CustomAttribute) owned by the
subscribing application is deleted. Custom attributes are owned by the application that created the
corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose
`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application. */
export type CustomerCustomAttributeOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a customer [custom attribute](entity:CustomAttribute) owned by the
subscribing application is created or updated. Custom attributes are owned by the application that created
the corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose
`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application. */
export type CustomerCustomAttributeOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a customer [custom attribute](entity:CustomAttribute) owned by the
subscribing application is created or updated. Custom attributes are owned by the application that created
the corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose
`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application.

This event is replaced by 
[customer.custom_attribute.owned.updated](webhook:customer.custom_attribute.owned.updated). */
export type CustomerCustomAttributeUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a customer [custom attribute](entity:CustomAttribute) that is visible
to all applications is created or updated. A notification is sent when any application creates or updates
a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.

This event is replaced by 
[customer.custom_attribute.visible.updated](webhook:customer.custom_attribute.visible.updated),
which applies to custom attributes that are visible to the subscribing application. */
export type CustomerCustomAttributeUpdatedPublicEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the
subscribing application is deleted. A notification is sent when:
- Your application deletes a custom attribute owned by your application, regardless of the `visibility` setting.
- Any application deletes a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`
or `VISIBILITY_READ_WRITE_VALUES`.

Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application, but those set to
`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the owner. Custom attributes are owned
by the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). */
export type CustomerCustomAttributeVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the
subscribing application is created or updated. A notification is sent when:
- Your application creates or updates a custom attribute owned by your application, regardless of the `visibility` setting.
- Any application creates or updates a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`
or `VISIBILITY_READ_WRITE_VALUES`.

Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application, but those set to
`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or updated by the owner. Custom attributes are owned
by the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). */
export type CustomerCustomAttributeVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a [customer](entity:Customer) is deleted.  For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).

The `customer` object in the event notification does not include the following fields: `group_ids` and `segment_ids`. */
export type CustomerDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomerDeletedEventData;
};

/** The data associated with the event. */
export type CustomerDeletedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CustomerDeletedEventObject;
};

/** Information about the change that triggered the event. */
export type CustomerDeletedEventEventContext = {
  "merge"?: CustomerDeletedEventEventContextMerge;
};

/** Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers. */
export type CustomerDeletedEventEventContextMerge = {
  "from_customer_ids"?: Array<string>;
  "to_customer_id"?: string;
};

/** An object that contains the customer associated with the event. */
export type CustomerDeletedEventObject = {
  "customer"?: Customer;
  "event_context"?: CustomerDeletedEventEventContext;
};

/** Details about the customer making the payment. */
export type CustomerDetails = {
  "customer_initiated"?: boolean;
  "seller_keyed_in"?: boolean;
};

/** Represents the filtering criteria in a [search query](entity:CustomerQuery) that defines how to filter
customer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. */
export type CustomerFilter = {
  "creation_source"?: CustomerCreationSourceFilter;
  "created_at"?: TimeRange;
  "updated_at"?: TimeRange;
  "email_address"?: CustomerTextFilter;
  "phone_number"?: CustomerTextFilter;
  "reference_id"?: CustomerTextFilter;
  "group_ids"?: FilterValue;
  "custom_attribute"?: CustomerCustomAttributeFilters;
  "segment_ids"?: FilterValue;
};

/** 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. */
export type CustomerGroup = {
  "id"?: string;
  "name": string;
  "created_at"?: string;
  "updated_at"?: string;
};

/** Indicates whether customers should be included in, or excluded from,
the result set when they match the filtering criteria. */
export type CustomerInclusionExclusion = "INCLUDE" | "EXCLUDE";

/** Represents communication preferences for the customer profile. */
export type CustomerPreferences = {
  "email_unsubscribed"?: boolean;
};

/** Represents filtering and sorting criteria for a [SearchCustomers](api-endpoint:Customers-SearchCustomers) request. */
export type CustomerQuery = {
  "filter"?: CustomerFilter;
  "sort"?: CustomerSort;
};

/** 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. */
export type CustomerSegment = {
  "id"?: string;
  "name": string;
  "created_at"?: string;
  "updated_at"?: string;
};

/** Represents the sorting criteria in a [search query](entity:CustomerQuery) that defines how to sort
customer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. */
export type CustomerSort = {
  "field"?: CustomerSortField;
  "order"?: SortOrder;
};

/** Specifies customer attributes as the sort key to customer profiles returned from a search. */
export type CustomerSortField = "DEFAULT" | "CREATED_AT";

/** Represents the tax ID associated with a [customer profile](entity: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). */
export type CustomerTaxIds = {
  "eu_vat"?: string;
};

/** 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. */
export type CustomerTextFilter = {
  "exact"?: string;
  "fuzzy"?: string;
};

/** Published when a [customer](entity:Customer) is updated. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).

Updates to the 'segment_ids' customer field does not invoke a `customer.updated` event. In addition, the `customer` object in the event notification does not include this field. */
export type CustomerUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomerUpdatedEventData;
};

/** The data associated with the event. */
export type CustomerUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: CustomerUpdatedEventObject;
};

/** An object that contains the customer associated with the event. */
export type CustomerUpdatedEventObject = {
  "customer"?: Customer;
};

export type DataCollectionOptions = {
  "title": string;
  "body": string;
  "input_type": DataCollectionOptionsInputType;
  "collected_data"?: CollectedData;
};

/** Describes the input type of the data. */
export type DataCollectionOptionsInputType = "EMAIL" | "PHONE_NUMBER";

/** A range defined by two dates. Used for filtering a query for Connect v2
objects that have date properties. */
export type DateRange = {
  "start_date"?: string;
  "end_date"?: string;
};

/** Indicates the specific day  of the week. */
export type DayOfWeek = "SUN" | "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT";

/** Represents a [DeleteBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttributeDefinition) response
containing error messages when errors occurred during the request. The successful response does not contain any payload. */
export type DeleteBookingCustomAttributeDefinitionResponse = {
  "errors"?: Array<Error>;
};

/** Represents a [DeleteBookingCustomAttribute](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttribute) response.
Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. */
export type DeleteBookingCustomAttributeResponse = {
  "errors"?: Array<Error>;
};

/** The response to a request to delete a `BreakType`. The response might contain a set 
of `Error` objects if the request resulted in errors. */
export type DeleteBreakTypeResponse = {
  "errors"?: Array<Error>;
};

export type DeleteCatalogObjectResponse = {
  "errors"?: Array<Error>;
  "deleted_object_ids"?: Array<string>;
  "deleted_at"?: string;
};

/** Defines the fields that are included in the response body of
a request to the `DeleteCustomerCard` endpoint. */
export type DeleteCustomerCardResponse = {
  "errors"?: Array<Error>;
};

/** Represents a response from a delete request containing error messages if there are any. */
export type DeleteCustomerCustomAttributeDefinitionResponse = {
  "errors"?: Array<Error>;
};

/** Represents a [DeleteCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-DeleteCustomerCustomAttribute) response.
Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. */
export type DeleteCustomerCustomAttributeResponse = {
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [DeleteCustomerGroup](api-endpoint:CustomerGroups-DeleteCustomerGroup) endpoint. */
export type DeleteCustomerGroupResponse = {
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the `DeleteCustomer` endpoint. */
export type DeleteCustomerResponse = {
  "errors"?: Array<Error>;
};

/** Defines the fields in a `DeleteDisputeEvidence` response. */
export type DeleteDisputeEvidenceResponse = {
  "errors"?: Array<Error>;
};

/** Represents a [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) response. */
export type DeleteInvoiceAttachmentResponse = {
  "errors"?: Array<Error>;
};

/** Describes a `DeleteInvoice` response. */
export type DeleteInvoiceResponse = {
  "errors"?: Array<Error>;
};

/** Represents a response from a delete request containing error messages if there are any. */
export type DeleteLocationCustomAttributeDefinitionResponse = {
  "errors"?: Array<Error>;
};

/** Represents a [DeleteLocationCustomAttribute](api-endpoint:LocationCustomAttributes-DeleteLocationCustomAttribute) response.
Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. */
export type DeleteLocationCustomAttributeResponse = {
  "errors"?: Array<Error>;
};

/** A response returned by the API call. */
export type DeleteLoyaltyRewardResponse = {
  "errors"?: Array<Error>;
};

/** Represents a response from a delete request containing error messages if there are any. */
export type DeleteMerchantCustomAttributeDefinitionResponse = {
  "errors"?: Array<Error>;
};

/** Represents a [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) response.
Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. */
export type DeleteMerchantCustomAttributeResponse = {
  "errors"?: Array<Error>;
};

/** Represents a response from deleting an order custom attribute definition. */
export type DeleteOrderCustomAttributeDefinitionResponse = {
  "errors"?: Array<Error>;
};

/** Represents a response from deleting an order custom attribute. */
export type DeleteOrderCustomAttributeResponse = {
  "errors"?: Array<Error>;
};

export type DeletePaymentLinkResponse = {
  "errors"?: Array<Error>;
  "id"?: string;
  "cancelled_order_id"?: string;
};

/** The response to a request to delete a `Shift`. The response might contain a set of 
`Error` objects if the request resulted in errors. */
export type DeleteShiftResponse = {
  "errors"?: Array<Error>;
};

/** Represents a `DeleteSnippet` response. */
export type DeleteSnippetResponse = {
  "errors"?: Array<Error>;
};

/** Defines output parameters in a response of the [DeleteSubscriptionAction](api-endpoint:Subscriptions-DeleteSubscriptionAction)
endpoint. */
export type DeleteSubscriptionActionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
};

/** The response to a request to delete a `Timecard`. The response might contain a set of 
`Error` objects if the request resulted in errors. */
export type DeleteTimecardResponse = {
  "errors"?: Array<Error>;
};

/** Response for deleting a transfer order */
export type DeleteTransferOrderResponse = {
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [DeleteWebhookSubscription](api-endpoint:WebhookSubscriptions-DeleteWebhookSubscription) endpoint. */
export type DeleteWebhookSubscriptionResponse = {
  "errors"?: Array<Error>;
};

/** Information about the destination against which the payout was made. */
export type Destination = {
  "type"?: DestinationType;
  "id"?: string;
};

/** Details about a refund's destination. */
export type DestinationDetails = {
  "card_details"?: DestinationDetailsCardRefundDetails;
  "cash_details"?: DestinationDetailsCashRefundDetails;
  "external_details"?: DestinationDetailsExternalRefundDetails;
};

export type DestinationDetailsCardRefundDetails = {
  "card"?: Card;
  "entry_method"?: string;
  "auth_result_code"?: string;
};

/** Stores details about a cash refund. Contains only non-confidential information. */
export type DestinationDetailsCashRefundDetails = {
  "seller_supplied_money": Money;
  "change_back_money"?: Money;
};

/** Stores details about an external refund. Contains only non-confidential information. */
export type DestinationDetailsExternalRefundDetails = {
  "type": string;
  "source": string;
  "source_id"?: string;
};

/** List of possible destinations against which a payout can be made. */
export type DestinationType = "BANK_ACCOUNT" | "CARD" | "SQUARE_BALANCE" | "SQUARE_STORED_BALANCE";

export type Device = {
  "id"?: string;
  "attributes": DeviceAttributes;
  "components"?: Array<Component>;
  "status"?: DeviceStatus;
};

export type DeviceAttributes = {
  "type": DeviceAttributesDeviceType;
  "manufacturer": string;
  "model"?: string;
  "name"?: string;
  "manufacturers_id"?: string;
  "updated_at"?: string;
  "version"?: string;
  "merchant_token"?: string;
};

/** An enum identifier of the device type. */
export type DeviceAttributesDeviceType = "TERMINAL" | "HANDHELD";

export type DeviceCheckoutOptions = {
  "device_id": string;
  "skip_receipt_screen"?: boolean;
  "collect_signature"?: boolean;
  "tip_settings"?: TipSettings;
  "show_itemized_cart"?: boolean;
  "allow_auto_card_surcharge"?: boolean;
};

export type DeviceCode = {
  "id"?: string;
  "name"?: string;
  "code"?: string;
  "device_id"?: string;
  "product_type": ProductType;
  "location_id"?: string;
  "status"?: DeviceCodeStatus;
  "pair_by"?: string;
  "created_at"?: string;
  "status_changed_at"?: string;
  "paired_at"?: string;
};

/** Published when a Square Terminal has been paired with a
Terminal API client and the device_id of the paired Square Terminal is
available. */
export type DeviceCodePairedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DeviceCodePairedEventData;
};

export type DeviceCodePairedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DeviceCodePairedEventObject;
};

export type DeviceCodePairedEventObject = {
  "device_code"?: DeviceCode;
};

/** DeviceCode.Status enum. */
export type DeviceCodeStatus = "UNKNOWN" | "UNPAIRED" | "PAIRED" | "EXPIRED";

export type DeviceComponentDetailsApplicationDetails = {
  "application_type"?: ApplicationType;
  "version"?: string;
  "session_location"?: string;
  "device_code_id"?: string;
};

export type DeviceComponentDetailsBatteryDetails = {
  "visible_percent"?: number;
  "external_power"?: DeviceComponentDetailsExternalPower;
};

export type DeviceComponentDetailsCardReaderDetails = {
  "version"?: string;
};

export type DeviceComponentDetailsEthernetDetails = {
  "active"?: boolean;
  "ip_address_v4"?: string;
  "mac_address"?: string;
};

/** An enum for ExternalPower. */
export type DeviceComponentDetailsExternalPower = "AVAILABLE_CHARGING" | "AVAILABLE_NOT_IN_USE" | "UNAVAILABLE" | "AVAILABLE_INSUFFICIENT";

/** A value qualified by unit of measure. */
export type DeviceComponentDetailsMeasurement = {
  "value"?: number;
};

export type DeviceComponentDetailsWiFiDetails = {
  "active"?: boolean;
  "ssid"?: string;
  "ip_address_v4"?: string;
  "secure_connection"?: string;
  "signal_strength"?: DeviceComponentDetailsMeasurement;
  "mac_address"?: string;
};

/** Published when a Device is created. */
export type DeviceCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DeviceCreatedEventData;
};

export type DeviceCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DeviceCreatedEventObject;
};

export type DeviceCreatedEventObject = {
  "device"?: Device;
};

/** Details about the device that took the payment. */
export type DeviceDetails = {
  "device_id"?: string;
  "device_installation_id"?: string;
  "device_name"?: string;
};

export type DeviceMetadata = {
  "battery_percentage"?: string;
  "charging_state"?: string;
  "location_id"?: string;
  "merchant_id"?: string;
  "network_connection_type"?: string;
  "payment_region"?: string;
  "serial_number"?: string;
  "os_version"?: string;
  "app_version"?: string;
  "wifi_network_name"?: string;
  "wifi_network_strength"?: string;
  "ip_address"?: string;
};

export type DeviceStatus = {
  "category"?: DeviceStatusCategory;
};

export type DeviceStatusCategory = "AVAILABLE" | "NEEDS_ATTENTION" | "OFFLINE";

/** Additional details about `WALLET` type payments. Contains only non-confidential information. */
export type DigitalWalletDetails = {
  "status"?: string;
  "brand"?: string;
  "cash_app_details"?: CashAppDetails;
  "lightning_details"?: LightningDetails;
  "errors"?: Array<Error>;
};

/** Response object returned by `DisableBankAccount`. */
export type DisableBankAccountResponse = {
  "bank_account"?: BankAccount;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [DisableCard](api-endpoint:Cards-DisableCard) endpoint.

Note: if there are errors processing the request, the card field will not be
present. */
export type DisableCardResponse = {
  "errors"?: Array<Error>;
  "card"?: Card;
};

/** Defines the fields that are included in the response body of
a request to the [DisableEvents](api-endpoint:Events-DisableEvents) endpoint.

Note: if there are errors processing the request, the events field will not be
present. */
export type DisableEventsResponse = {
  "errors"?: Array<Error>;
};

export type DismissTerminalActionResponse = {
  "errors"?: Array<Error>;
  "action"?: TerminalAction;
};

export type DismissTerminalCheckoutResponse = {
  "errors"?: Array<Error>;
  "checkout"?: TerminalCheckout;
};

export type DismissTerminalRefundResponse = {
  "errors"?: Array<Error>;
  "refund"?: TerminalRefund;
};

/** Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. */
export type Dispute = {
  "dispute_id"?: string;
  "id"?: string;
  "amount_money"?: Money;
  "reason"?: DisputeReason;
  "state"?: DisputeState;
  "due_at"?: string;
  "disputed_payment"?: DisputedPayment;
  "evidence_ids"?: Array<string>;
  "card_brand"?: CardBrand;
  "created_at"?: string;
  "updated_at"?: string;
  "brand_dispute_id"?: string;
  "reported_date"?: string;
  "reported_at"?: string;
  "version"?: number;
  "location_id"?: string;
};

/** Published when a [Dispute](entity:Dispute) is created. */
export type DisputeCreatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DisputeCreatedEventData;
};

export type DisputeCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DisputeCreatedEventObject;
};

export type DisputeCreatedEventObject = {
  "object"?: Dispute;
};

export type DisputeEvidence = {
  "evidence_id"?: string;
  "id"?: string;
  "dispute_id"?: string;
  "evidence_file"?: DisputeEvidenceFile;
  "evidence_text"?: string;
  "uploaded_at"?: string;
  "evidence_type"?: DisputeEvidenceType;
};

/** Published when evidence is added to a [Dispute](entity:Dispute)
from the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,
or by calling either [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) or [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText). */
export type DisputeEvidenceAddedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DisputeEvidenceAddedEventData;
};

export type DisputeEvidenceAddedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DisputeEvidenceAddedEventObject;
};

export type DisputeEvidenceAddedEventObject = {
  "object"?: Dispute;
};

/** Published when evidence is added to a [Dispute](entity:Dispute)
from the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,
or by calling either [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) or [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText). */
export type DisputeEvidenceCreatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DisputeEvidenceCreatedEventData;
};

export type DisputeEvidenceCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DisputeEvidenceCreatedEventObject;
};

export type DisputeEvidenceCreatedEventObject = {
  "object"?: Dispute;
};

/** Published when evidence is removed from a [Dispute](entity:Dispute)
from the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,
or by calling [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence). */
export type DisputeEvidenceDeletedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DisputeEvidenceDeletedEventData;
};

export type DisputeEvidenceDeletedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DisputeEvidenceDeletedEventObject;
};

export type DisputeEvidenceDeletedEventObject = {
  "object"?: Dispute;
};

/** A file to be uploaded as dispute evidence. */
export type DisputeEvidenceFile = {
  "filename"?: string;
  "filetype"?: string;
};

/** Published when evidence is removed from a [Dispute](entity:Dispute)
from the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,
or by calling [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence). */
export type DisputeEvidenceRemovedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DisputeEvidenceRemovedEventData;
};

export type DisputeEvidenceRemovedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DisputeEvidenceRemovedEventObject;
};

export type DisputeEvidenceRemovedEventObject = {
  "object"?: Dispute;
};

/** The type of the dispute evidence. */
export type DisputeEvidenceType = "GENERIC_EVIDENCE" | "ONLINE_OR_APP_ACCESS_LOG" | "AUTHORIZATION_DOCUMENTATION" | "CANCELLATION_OR_REFUND_DOCUMENTATION" | "CARDHOLDER_COMMUNICATION" | "CARDHOLDER_INFORMATION" | "PURCHASE_ACKNOWLEDGEMENT" | "DUPLICATE_CHARGE_DOCUMENTATION" | "PRODUCT_OR_SERVICE_DESCRIPTION" | "RECEIPT" | "SERVICE_RECEIVED_DOCUMENTATION" | "PROOF_OF_DELIVERY_DOCUMENTATION" | "RELATED_TRANSACTION_DOCUMENTATION" | "REBUTTAL_EXPLANATION" | "TRACKING_NUMBER";

/** The list of possible reasons why a cardholder might initiate a
dispute with their bank. */
export type DisputeReason = "AMOUNT_DIFFERS" | "CANCELLED" | "DUPLICATE" | "NO_KNOWLEDGE" | "NOT_AS_DESCRIBED" | "NOT_RECEIVED" | "PAID_BY_OTHER_MEANS" | "CUSTOMER_REQUESTS_CREDIT" | "EMV_LIABILITY_SHIFT";

/** The list of possible dispute states. */
export type DisputeState = "INQUIRY_EVIDENCE_REQUIRED" | "INQUIRY_PROCESSING" | "INQUIRY_CLOSED" | "EVIDENCE_REQUIRED" | "PROCESSING" | "WON" | "LOST" | "ACCEPTED";

/** Published when the state of a [Dispute](entity:Dispute) changes.
This includes the dispute resolution (WON, LOST) reported by the bank. The event
data includes details of what changed. */
export type DisputeStateChangedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DisputeStateChangedEventData;
};

export type DisputeStateChangedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DisputeStateChangedEventObject;
};

export type DisputeStateChangedEventObject = {
  "object"?: Dispute;
};

/** Published when the state of a [Dispute](entity:Dispute) changes.
This includes the dispute resolution (WON, LOST) reported by the bank. The event
data includes details of what changed. */
export type DisputeStateUpdatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: DisputeStateUpdatedEventData;
};

export type DisputeStateUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: DisputeStateUpdatedEventObject;
};

export type DisputeStateUpdatedEventObject = {
  "object"?: Dispute;
};

/** The payment the cardholder disputed. */
export type DisputedPayment = {
  "payment_id"?: string;
};

/** Determines item visibility in Ecom (Online Store) and Online Checkout. */
export type EcomVisibility = "UNINDEXED" | "UNAVAILABLE" | "HIDDEN" | "VISIBLE";

/** Details specific to electronic money payments. */
export type ElectronicMoneyDetails = {
  "felica_details"?: FelicaDetails;
};

/** An employee object that is used by the external API.

DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember). */
export type Employee = {
  "id"?: string;
  "first_name"?: string;
  "last_name"?: string;
  "email"?: string;
  "phone_number"?: string;
  "location_ids"?: Array<string>;
  "status"?: EmployeeStatus;
  "is_owner"?: boolean;
  "created_at"?: string;
  "updated_at"?: string;
};

/** The status of the Employee being retrieved.

DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). */
export type EmployeeStatus = "ACTIVE" | "INACTIVE";

/** The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). */
export type EmployeeWage = {
  "id"?: string;
  "employee_id"?: string;
  "title"?: string;
  "hourly_rate"?: Money;
};

/** Defines the fields that are included in the response body of
a request to the [EnableEvents](api-endpoint:Events-EnableEvents) endpoint.

Note: if there are errors processing the request, the events field will not be
present. */
export type EnableEventsResponse = {
  "errors"?: Array<Error>;
};

/** 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. */
export type Error = {
  "category": ErrorCategory;
  "code": ErrorCode;
  "detail"?: string;
  "field"?: string;
};

/** Indicates which high-level category of error has occurred during a
request to the Connect API. */
export type ErrorCategory = "API_ERROR" | "AUTHENTICATION_ERROR" | "INVALID_REQUEST_ERROR" | "RATE_LIMIT_ERROR" | "PAYMENT_METHOD_ERROR" | "REFUND_ERROR" | "MERCHANT_SUBSCRIPTION_ERROR" | "EXTERNAL_VENDOR_ERROR";

/** Indicates the specific error that occurred during a request to a
Square API. */
export type ErrorCode = "INTERNAL_SERVER_ERROR" | "UNAUTHORIZED" | "ACCESS_TOKEN_EXPIRED" | "ACCESS_TOKEN_REVOKED" | "CLIENT_DISABLED" | "FORBIDDEN" | "INSUFFICIENT_SCOPES" | "APPLICATION_DISABLED" | "V1_APPLICATION" | "V1_ACCESS_TOKEN" | "CARD_PROCESSING_NOT_ENABLED" | "MERCHANT_SUBSCRIPTION_NOT_FOUND" | "BAD_REQUEST" | "MISSING_REQUIRED_PARAMETER" | "INCORRECT_TYPE" | "INVALID_TIME" | "INVALID_TIME_RANGE" | "INVALID_VALUE" | "INVALID_CURSOR" | "UNKNOWN_QUERY_PARAMETER" | "CONFLICTING_PARAMETERS" | "EXPECTED_JSON_BODY" | "INVALID_SORT_ORDER" | "VALUE_REGEX_MISMATCH" | "VALUE_TOO_SHORT" | "VALUE_TOO_LONG" | "VALUE_TOO_LOW" | "VALUE_TOO_HIGH" | "VALUE_EMPTY" | "ARRAY_LENGTH_TOO_LONG" | "ARRAY_LENGTH_TOO_SHORT" | "ARRAY_EMPTY" | "EXPECTED_BOOLEAN" | "EXPECTED_INTEGER" | "EXPECTED_FLOAT" | "EXPECTED_STRING" | "EXPECTED_OBJECT" | "EXPECTED_ARRAY" | "EXPECTED_MAP" | "EXPECTED_BASE64_ENCODED_BYTE_ARRAY" | "INVALID_ARRAY_VALUE" | "INVALID_ENUM_VALUE" | "INVALID_CONTENT_TYPE" | "INVALID_FORM_VALUE" | "CUSTOMER_NOT_FOUND" | "ONE_INSTRUMENT_EXPECTED" | "NO_FIELDS_SET" | "TOO_MANY_MAP_ENTRIES" | "MAP_KEY_LENGTH_TOO_SHORT" | "MAP_KEY_LENGTH_TOO_LONG" | "CUSTOMER_MISSING_NAME" | "CUSTOMER_MISSING_EMAIL" | "INVALID_PAUSE_LENGTH" | "INVALID_DATE" | "UNSUPPORTED_COUNTRY" | "UNSUPPORTED_CURRENCY" | "APPLE_TTP_PIN_TOKEN" | "CARD_EXPIRED" | "INVALID_EXPIRATION" | "INVALID_EXPIRATION_YEAR" | "INVALID_EXPIRATION_DATE" | "UNSUPPORTED_CARD_BRAND" | "UNSUPPORTED_ENTRY_METHOD" | "INVALID_ENCRYPTED_CARD" | "INVALID_CARD" | "PAYMENT_AMOUNT_MISMATCH" | "GENERIC_DECLINE" | "CVV_FAILURE" | "ADDRESS_VERIFICATION_FAILURE" | "INVALID_ACCOUNT" | "CURRENCY_MISMATCH" | "INSUFFICIENT_FUNDS" | "INSUFFICIENT_PERMISSIONS" | "CARDHOLDER_INSUFFICIENT_PERMISSIONS" | "INVALID_LOCATION" | "TRANSACTION_LIMIT" | "VOICE_FAILURE" | "PAN_FAILURE" | "EXPIRATION_FAILURE" | "CARD_NOT_SUPPORTED" | "READER_DECLINED" | "INVALID_PIN" | "MISSING_PIN" | "MISSING_ACCOUNT_TYPE" | "INVALID_POSTAL_CODE" | "INVALID_FEES" | "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED" | "PAYMENT_LIMIT_EXCEEDED" | "GIFT_CARD_AVAILABLE_AMOUNT" | "ACCOUNT_UNUSABLE" | "BUYER_REFUSED_PAYMENT" | "DELAYED_TRANSACTION_EXPIRED" | "DELAYED_TRANSACTION_CANCELED" | "DELAYED_TRANSACTION_CAPTURED" | "DELAYED_TRANSACTION_FAILED" | "CARD_TOKEN_EXPIRED" | "CARD_TOKEN_USED" | "AMOUNT_TOO_HIGH" | "UNSUPPORTED_INSTRUMENT_TYPE" | "REFUND_AMOUNT_INVALID" | "REFUND_ALREADY_PENDING" | "PAYMENT_NOT_REFUNDABLE" | "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE" | "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION" | "REFUND_DECLINED" | "INSUFFICIENT_PERMISSIONS_FOR_REFUND" | "INVALID_CARD_DATA" | "SOURCE_USED" | "SOURCE_EXPIRED" | "UNSUPPORTED_LOYALTY_REWARD_TIER" | "LOCATION_MISMATCH" | "ORDER_UNPAID_NOT_RETURNABLE" | "PARTIAL_PAYMENT_DELAY_CAPTURE_NOT_SUPPORTED" | "IDEMPOTENCY_KEY_REUSED" | "UNEXPECTED_VALUE" | "SANDBOX_NOT_SUPPORTED" | "INVALID_EMAIL_ADDRESS" | "INVALID_PHONE_NUMBER" | "CHECKOUT_EXPIRED" | "BAD_CERTIFICATE" | "INVALID_SQUARE_VERSION_FORMAT" | "API_VERSION_INCOMPATIBLE" | "CARD_PRESENCE_REQUIRED" | "UNSUPPORTED_SOURCE_TYPE" | "CARD_MISMATCH" | "PLAID_ERROR" | "PLAID_ERROR_ITEM_LOGIN_REQUIRED" | "PLAID_ERROR_RATE_LIMIT" | "PAYMENT_SOURCE_NOT_ENABLED_FOR_TARGET" | "CARD_DECLINED" | "VERIFY_CVV_FAILURE" | "VERIFY_AVS_FAILURE" | "CARD_DECLINED_CALL_ISSUER" | "CARD_DECLINED_VERIFICATION_REQUIRED" | "BAD_EXPIRATION" | "CHIP_INSERTION_REQUIRED" | "ALLOWABLE_PIN_TRIES_EXCEEDED" | "RESERVATION_DECLINED" | "UNKNOWN_BODY_PARAMETER" | "NOT_FOUND" | "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "REQUEST_ENTITY_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "RATE_LIMITED" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "TEMPORARY_ERROR" | "GATEWAY_TIMEOUT";

export type Event = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: EventData;
};

export type EventData = {
  "type"?: string;
  "id"?: string;
  "deleted"?: boolean;
  "object"?: Record<string, unknown>;
};

/** Contains metadata about a particular [Event](entity:Event). */
export type EventMetadata = {
  "event_id"?: string;
  "api_version"?: string;
};

/** Contains the metadata of a webhook event type. */
export type EventTypeMetadata = {
  "event_type"?: string;
  "api_version_introduced"?: string;
  "release_status"?: string;
};

/** Indicates which products matched by a CatalogPricingRule
will be excluded if the pricing rule uses an exclude set. */
export type ExcludeStrategy = "LEAST_EXPENSIVE" | "MOST_EXPENSIVE";

/** 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). */
export type ExternalPaymentDetails = {
  "type": string;
  "source": string;
  "source_id"?: string;
  "source_fee_money"?: Money;
};

/** Details for Felica payments. */
export type FelicaDetails = {
  "terminal_id"?: string;
  "felica_masked_card_number"?: string;
  "felica_brand"?: FelicaDetailsFelicaBrand;
};

/** A Felica card's "sub-brand"--the actual brand on the Felica card */
export type FelicaDetailsFelicaBrand = "UNKNOWN" | "FELICA_ID" | "FELICA_TRANSPORTATION" | "FELICA_QP";

/** 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. */
export type FilterValue = {
  "all"?: Array<string>;
  "any"?: Array<string>;
  "none"?: Array<string>;
};

/** Specifies a decimal number range. */
export type FloatNumberRange = {
  "start_at"?: string;
  "end_at"?: string;
};

/** 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. */
export type Fulfillment = {
  "uid"?: string;
  "type"?: FulfillmentType;
  "state"?: FulfillmentState;
  "line_item_application"?: FulfillmentFulfillmentLineItemApplication;
  "entries"?: Array<FulfillmentFulfillmentEntry>;
  "metadata"?: Record<string, string>;
  "pickup_details"?: FulfillmentPickupDetails;
  "shipment_details"?: FulfillmentShipmentDetails;
  "delivery_details"?: FulfillmentDeliveryDetails;
};

/** Describes delivery details of an order fulfillment. */
export type FulfillmentDeliveryDetails = {
  "recipient"?: FulfillmentRecipient;
  "schedule_type"?: FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType;
  "placed_at"?: string;
  "deliver_at"?: string;
  "prep_time_duration"?: string;
  "delivery_window_duration"?: string;
  "note"?: string;
  "completed_at"?: string;
  "in_progress_at"?: string;
  "rejected_at"?: string;
  "ready_at"?: string;
  "delivered_at"?: string;
  "canceled_at"?: string;
  "cancel_reason"?: string;
  "courier_pickup_at"?: string;
  "courier_pickup_window_duration"?: string;
  "is_no_contact_delivery"?: boolean;
  "dropoff_notes"?: string;
  "courier_provider_name"?: string;
  "courier_support_phone_number"?: string;
  "square_delivery_id"?: string;
  "external_delivery_id"?: string;
  "managed_delivery"?: boolean;
};

/** The schedule type of the delivery fulfillment. */
export type FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED" | "ASAP";

/** 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. */
export type FulfillmentFulfillmentEntry = {
  "uid"?: string;
  "line_item_uid": string;
  "quantity": string;
  "metadata"?: Record<string, string>;
};

/** 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. */
export type FulfillmentFulfillmentLineItemApplication = "ALL" | "ENTRY_LIST";

/** Contains details necessary to fulfill a pickup order. */
export type FulfillmentPickupDetails = {
  "recipient"?: FulfillmentRecipient;
  "expires_at"?: string;
  "auto_complete_duration"?: string;
  "schedule_type"?: FulfillmentPickupDetailsScheduleType;
  "pickup_at"?: string;
  "pickup_window_duration"?: string;
  "prep_time_duration"?: string;
  "note"?: string;
  "placed_at"?: string;
  "accepted_at"?: string;
  "rejected_at"?: string;
  "ready_at"?: string;
  "expired_at"?: string;
  "picked_up_at"?: string;
  "canceled_at"?: string;
  "cancel_reason"?: string;
  "is_curbside_pickup"?: boolean;
  "curbside_pickup_details"?: FulfillmentPickupDetailsCurbsidePickupDetails;
};

/** Specific details for curbside pickup. */
export type FulfillmentPickupDetailsCurbsidePickupDetails = {
  "curbside_details"?: string;
  "buyer_arrived_at"?: string;
};

/** The schedule type of the pickup fulfillment. */
export type FulfillmentPickupDetailsScheduleType = "SCHEDULED" | "ASAP";

/** Information about the fulfillment recipient. */
export type FulfillmentRecipient = {
  "customer_id"?: string;
  "display_name"?: string;
  "email_address"?: string;
  "phone_number"?: string;
  "address"?: Address;
};

/** Contains the details necessary to fulfill a shipment order. */
export type FulfillmentShipmentDetails = {
  "recipient"?: FulfillmentRecipient;
  "carrier"?: string;
  "shipping_note"?: string;
  "shipping_type"?: string;
  "tracking_number"?: string;
  "tracking_url"?: string;
  "placed_at"?: string;
  "in_progress_at"?: string;
  "packaged_at"?: string;
  "expected_shipped_at"?: string;
  "shipped_at"?: string;
  "canceled_at"?: string;
  "cancel_reason"?: string;
  "failed_at"?: string;
  "failure_reason"?: string;
};

/** The current state of this fulfillment. */
export type FulfillmentState = "PROPOSED" | "RESERVED" | "PREPARED" | "COMPLETED" | "CANCELED" | "FAILED";

/** The type of fulfillment. */
export type FulfillmentType = "PICKUP" | "SHIPMENT" | "DELIVERY";

/** Response object returned by GetBankAccountByV1Id. */
export type GetBankAccountByV1IdResponse = {
  "errors"?: Array<Error>;
  "bank_account"?: BankAccount;
};

/** Response object returned by `GetBankAccount`. */
export type GetBankAccountResponse = {
  "bank_account"?: BankAccount;
  "errors"?: Array<Error>;
};

/** The response to a request to get a `BreakType`. The response contains
the requested `BreakType` objects and might contain a set of `Error` objects if
the request resulted in errors. */
export type GetBreakTypeResponse = {
  "break_type"?: BreakType;
  "errors"?: Array<Error>;
};

export type GetDeviceCodeResponse = {
  "errors"?: Array<Error>;
  "device_code"?: DeviceCode;
};

export type GetDeviceResponse = {
  "errors"?: Array<Error>;
  "device"?: Device;
};

/** A response to a request to get an `EmployeeWage`. The response contains
the requested `EmployeeWage` objects and might contain a set of `Error` objects if
the request resulted in errors. */
export type GetEmployeeWageResponse = {
  "employee_wage"?: EmployeeWage;
  "errors"?: Array<Error>;
};

/** Describes a `GetInvoice` response. */
export type GetInvoiceResponse = {
  "invoice"?: Invoice;
  "errors"?: Array<Error>;
};

/** Defines the response returned by [GetRefund](api-endpoint:Refunds-GetPaymentRefund).

Note: If there are errors processing the request, the refund field might not be
present or it might be present in a FAILED state. */
export type GetPaymentRefundResponse = {
  "errors"?: Array<Error>;
  "refund"?: PaymentRefund;
};

/** Defines the response returned by [GetPayment](api-endpoint:Payments-GetPayment). */
export type GetPaymentResponse = {
  "errors"?: Array<Error>;
  "payment"?: Payment;
};

export type GetPayoutResponse = {
  "payout"?: Payout;
  "errors"?: Array<Error>;
};

/** A response to a request to get a `Shift`. The response contains
the requested `Shift` object and might contain a set of `Error` objects if
the request resulted in errors. */
export type GetShiftResponse = {
  "shift"?: Shift;
  "errors"?: Array<Error>;
};

/** A response to a request to get a `TeamMemberWage`. The response contains
the requested `TeamMemberWage` objects and might contain a set of `Error` objects if
the request resulted in errors. */
export type GetTeamMemberWageResponse = {
  "team_member_wage"?: TeamMemberWage;
  "errors"?: Array<Error>;
};

export type GetTerminalActionResponse = {
  "errors"?: Array<Error>;
  "action"?: TerminalAction;
};

export type GetTerminalCheckoutResponse = {
  "errors"?: Array<Error>;
  "checkout"?: TerminalCheckout;
};

export type GetTerminalRefundResponse = {
  "errors"?: Array<Error>;
  "refund"?: TerminalRefund;
};

/** Represents a Square gift card. */
export type GiftCard = {
  "id"?: string;
  "type": GiftCardType;
  "gan_source"?: GiftCardGANSource;
  "state"?: GiftCardStatus;
  "balance_money"?: Money;
  "gan"?: string;
  "created_at"?: string;
  "customer_ids"?: Array<string>;
};

/** Represents an action performed on a [gift card](entity:GiftCard) that affects its state or balance. 
A gift card activity contains information about a specific activity type. For example, a `REDEEM` activity
includes a `redeem_activity_details` field that contains information about the redemption. */
export type GiftCardActivity = {
  "id"?: string;
  "type": GiftCardActivityType;
  "location_id": string;
  "created_at"?: string;
  "gift_card_id"?: string;
  "gift_card_gan"?: string;
  "gift_card_balance_money"?: Money;
  "load_activity_details"?: GiftCardActivityLoad;
  "activate_activity_details"?: GiftCardActivityActivate;
  "redeem_activity_details"?: GiftCardActivityRedeem;
  "clear_balance_activity_details"?: GiftCardActivityClearBalance;
  "deactivate_activity_details"?: GiftCardActivityDeactivate;
  "adjust_increment_activity_details"?: GiftCardActivityAdjustIncrement;
  "adjust_decrement_activity_details"?: GiftCardActivityAdjustDecrement;
  "refund_activity_details"?: GiftCardActivityRefund;
  "unlinked_activity_refund_activity_details"?: GiftCardActivityUnlinkedActivityRefund;
  "import_activity_details"?: GiftCardActivityImport;
  "block_activity_details"?: GiftCardActivityBlock;
  "unblock_activity_details"?: GiftCardActivityUnblock;
  "import_reversal_activity_details"?: GiftCardActivityImportReversal;
  "transfer_balance_to_activity_details"?: GiftCardActivityTransferBalanceTo;
  "transfer_balance_from_activity_details"?: GiftCardActivityTransferBalanceFrom;
};

/** Represents details about an `ACTIVATE` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityActivate = {
  "amount_money"?: Money;
  "order_id"?: string;
  "line_item_uid"?: string;
  "reference_id"?: string;
  "buyer_payment_instrument_ids"?: Array<string>;
};

/** Represents details about an `ADJUST_DECREMENT` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityAdjustDecrement = {
  "amount_money": Money;
  "reason": GiftCardActivityAdjustDecrementReason;
};

/** Indicates the reason for deducting money from a [gift card](entity:GiftCard). */
export type GiftCardActivityAdjustDecrementReason = "SUSPICIOUS_ACTIVITY" | "BALANCE_ACCIDENTALLY_INCREASED" | "SUPPORT_ISSUE" | "PURCHASE_WAS_REFUNDED";

/** Represents details about an `ADJUST_INCREMENT` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityAdjustIncrement = {
  "amount_money": Money;
  "reason": GiftCardActivityAdjustIncrementReason;
};

/** Indicates the reason for adding money to a [gift card](entity:GiftCard). */
export type GiftCardActivityAdjustIncrementReason = "COMPLIMENTARY" | "SUPPORT_ISSUE" | "TRANSACTION_VOIDED";

/** Represents details about a `BLOCK` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityBlock = {
  "reason": GiftCardActivityBlockReason;
};

/** Indicates the reason for blocking a [gift card](entity:GiftCard). */
export type GiftCardActivityBlockReason = "CHARGEBACK_BLOCK";

/** Represents details about a `CLEAR_BALANCE` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityClearBalance = {
  "reason": GiftCardActivityClearBalanceReason;
};

/** Indicates the reason for clearing the balance of a [gift card](entity:GiftCard). */
export type GiftCardActivityClearBalanceReason = "SUSPICIOUS_ACTIVITY" | "REUSE_GIFTCARD" | "UNKNOWN_REASON";

/** Published when a [gift card activity](entity:GiftCardActivity) is created. */
export type GiftCardActivityCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: GiftCardActivityCreatedEventData;
};

/** Represents the data associated with a `gift_card.activity.created` event. */
export type GiftCardActivityCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: GiftCardActivityCreatedEventObject;
};

/** An object that contains the gift card activity associated with a 
`gift_card.activity.created` event. */
export type GiftCardActivityCreatedEventObject = {
  "gift_card_activity"?: GiftCardActivity;
};

/** Represents details about a `DEACTIVATE` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityDeactivate = {
  "reason": GiftCardActivityDeactivateReason;
};

/** Indicates the reason for deactivating a [gift card](entity:GiftCard). */
export type GiftCardActivityDeactivateReason = "SUSPICIOUS_ACTIVITY" | "UNKNOWN_REASON" | "CHARGEBACK_DEACTIVATE";

/** Represents details about an `IMPORT` [gift card activity type](entity:GiftCardActivityType).
This activity type is used when Square imports a third-party gift card, in which case the 
`gan_source` of the gift card is set to `OTHER`. */
export type GiftCardActivityImport = {
  "amount_money": Money;
};

/** Represents details about an `IMPORT_REVERSAL` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityImportReversal = {
  "amount_money": Money;
};

/** Represents details about a `LOAD` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityLoad = {
  "amount_money"?: Money;
  "order_id"?: string;
  "line_item_uid"?: string;
  "reference_id"?: string;
  "buyer_payment_instrument_ids"?: Array<string>;
};

/** Represents details about a `REDEEM` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityRedeem = {
  "amount_money": Money;
  "payment_id"?: string;
  "reference_id"?: string;
  "status"?: GiftCardActivityRedeemStatus;
};

/** Indicates the status of a [gift card](entity:GiftCard) redemption. This status is relevant only for
redemptions made from Square products (such as Square Point of Sale) because Square products use a 
two-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` status. */
export type GiftCardActivityRedeemStatus = "PENDING" | "COMPLETED" | "CANCELED";

/** Represents details about a `REFUND` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityRefund = {
  "redeem_activity_id"?: string;
  "amount_money"?: Money;
  "reference_id"?: string;
  "payment_id"?: string;
};

/** Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityTransferBalanceFrom = {
  "transfer_to_gift_card_id": string;
  "amount_money": Money;
};

/** Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityTransferBalanceTo = {
  "transfer_from_gift_card_id": string;
  "amount_money": Money;
};

/** Indicates the type of [gift card activity](entity:GiftCardActivity). */
export type GiftCardActivityType = "ACTIVATE" | "LOAD" | "REDEEM" | "CLEAR_BALANCE" | "DEACTIVATE" | "ADJUST_INCREMENT" | "ADJUST_DECREMENT" | "REFUND" | "UNLINKED_ACTIVITY_REFUND" | "IMPORT" | "BLOCK" | "UNBLOCK" | "IMPORT_REVERSAL" | "TRANSFER_BALANCE_FROM" | "TRANSFER_BALANCE_TO";

/** Represents details about an `UNBLOCK` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityUnblock = {
  "reason": GiftCardActivityUnblockReason;
};

/** Indicates the reason for unblocking a [gift card](entity:GiftCard). */
export type GiftCardActivityUnblockReason = "CHARGEBACK_UNBLOCK";

/** Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](entity:GiftCardActivityType). */
export type GiftCardActivityUnlinkedActivityRefund = {
  "amount_money": Money;
  "reference_id"?: string;
  "payment_id"?: string;
};

/** Published when a [gift card activity](entity:GiftCardActivity) is updated. 
Subscribe to this event to be notified about the following changes:
- An update to the `REDEEM` activity for a gift card redemption made from a Square product (such as Square Point of Sale). 
These redemptions are initially assigned a `PENDING` state, but then change to a `COMPLETED` or `CANCELED` state.
- An update to the `IMPORT` activity for an imported gift card when the balance is later adjusted by Square. */
export type GiftCardActivityUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: GiftCardActivityUpdatedEventData;
};

/** The data associated with a `gift_card.activity.updated` event. */
export type GiftCardActivityUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: GiftCardActivityUpdatedEventObject;
};

/** An object that contains the gift card activity associated with a 
`gift_card.activity.updated` event. */
export type GiftCardActivityUpdatedEventObject = {
  "gift_card_activity"?: GiftCardActivity;
};

/** Published when a [gift card](entity:GiftCard) is created. */
export type GiftCardCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: GiftCardCreatedEventData;
};

/** The data associated with a `gift_card.created` event. */
export type GiftCardCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: GiftCardCreatedEventObject;
};

/** An object that contains the gift card associated with a `gift_card.created` event. */
export type GiftCardCreatedEventObject = {
  "gift_card"?: GiftCard;
};

/** Published when a [customer](entity:Customer) is linked to a [gift card](entity:GiftCard). */
export type GiftCardCustomerLinkedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: GiftCardCustomerLinkedEventData;
};

/** The data associated with a `gift_card.customer_linked` event. */
export type GiftCardCustomerLinkedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: GiftCardCustomerLinkedEventObject;
};

/** An object that contains the gift card and customer ID associated with a 
`gift_card.customer_linked` event. */
export type GiftCardCustomerLinkedEventObject = {
  "gift_card"?: GiftCard;
  "linked_customer_id"?: string;
};

/** Published when a [customer](entity:Customer) is unlinked from a [gift card](entity:GiftCard). */
export type GiftCardCustomerUnlinkedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: GiftCardCustomerUnlinkedEventData;
};

/** The data associated with a `gift_card.customer_unlinked` event. */
export type GiftCardCustomerUnlinkedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: GiftCardCustomerUnlinkedEventObject;
};

/** An object that contains the gift card and the customer ID associated with a 
`gift_card.customer_linked` event. */
export type GiftCardCustomerUnlinkedEventObject = {
  "gift_card"?: GiftCard;
  "unlinked_customer_id"?: string;
};

/** Indicates the source that generated the gift card 
account number (GAN). */
export type GiftCardGANSource = "SQUARE" | "OTHER";

/** Indicates the gift card state. */
export type GiftCardStatus = "ACTIVE" | "DEACTIVATED" | "BLOCKED" | "PENDING";

/** Indicates the gift card type. */
export type GiftCardType = "PHYSICAL" | "DIGITAL";

/** Published when a [gift card](entity:GiftCard) is updated. This includes
changes to the state, balance, and customer association. */
export type GiftCardUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: GiftCardUpdatedEventData;
};

/** The data associated with a `gift_card.updated` event. */
export type GiftCardUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: GiftCardUpdatedEventObject;
};

/** An object that contains the gift card associated with a `gift_card.updated` event. */
export type GiftCardUpdatedEventObject = {
  "gift_card"?: GiftCard;
};

/** Represents a change in state or quantity of product inventory at a
particular time and location. */
export type InventoryAdjustment = {
  "id"?: string;
  "reference_id"?: string;
  "from_state"?: InventoryState;
  "to_state"?: InventoryState;
  "location_id"?: string;
  "catalog_object_id"?: string;
  "catalog_object_type"?: string;
  "quantity"?: string;
  "total_price_money"?: Money;
  "occurred_at"?: string;
  "created_at"?: string;
  "source"?: SourceApplication;
  "employee_id"?: string;
  "team_member_id"?: string;
  "transaction_id"?: string;
  "refund_id"?: string;
  "purchase_order_id"?: string;
  "goods_receipt_id"?: string;
  "adjustment_group"?: InventoryAdjustmentGroup;
};

export type InventoryAdjustmentGroup = {
  "id"?: string;
  "root_adjustment_id"?: string;
  "from_state"?: InventoryState;
  "to_state"?: InventoryState;
};

/** Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. */
export type InventoryAlertType = "NONE" | "LOW_QUANTITY";

/** Represents a single physical count, inventory, adjustment, or transfer
that is part of the history of inventory changes for a particular
[CatalogObject](entity:CatalogObject) instance. */
export type InventoryChange = {
  "type"?: InventoryChangeType;
  "physical_count"?: InventoryPhysicalCount;
  "adjustment"?: InventoryAdjustment;
  "transfer"?: InventoryTransfer;
  "measurement_unit"?: CatalogMeasurementUnit;
  "measurement_unit_id"?: string;
};

/** Indicates how the inventory change was applied to a tracked product quantity. */
export type InventoryChangeType = "PHYSICAL_COUNT" | "ADJUSTMENT" | "TRANSFER";

/** Represents Square-estimated quantity of items in a particular state at a
particular seller location based on the known history of physical counts and
inventory adjustments. */
export type InventoryCount = {
  "catalog_object_id"?: string;
  "catalog_object_type"?: string;
  "state"?: InventoryState;
  "location_id"?: string;
  "quantity"?: string;
  "calculated_at"?: string;
  "is_estimated"?: boolean;
};

/** Published when the quantity is updated for a
[CatalogItemVariation](entity:CatalogItemVariation). */
export type InventoryCountUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InventoryCountUpdatedEventData;
};

export type InventoryCountUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: InventoryCountUpdatedEventObject;
};

export type InventoryCountUpdatedEventObject = {
  "inventory_counts"?: Array<InventoryCount>;
};

/** Represents the quantity of an item variation that is physically present
at a specific location, verified by a seller or a seller's employee. For example,
a physical count might come from an employee counting the item variations on
hand or from syncing with an external system. */
export type InventoryPhysicalCount = {
  "id"?: string;
  "reference_id"?: string;
  "catalog_object_id"?: string;
  "catalog_object_type"?: string;
  "state"?: InventoryState;
  "location_id"?: string;
  "quantity"?: string;
  "source"?: SourceApplication;
  "employee_id"?: string;
  "team_member_id"?: string;
  "occurred_at"?: string;
  "created_at"?: string;
};

/** Indicates the state of a tracked item quantity in the lifecycle of goods. */
export type InventoryState = "CUSTOM" | "IN_STOCK" | "SOLD" | "RETURNED_BY_CUSTOMER" | "RESERVED_FOR_SALE" | "SOLD_ONLINE" | "ORDERED_FROM_VENDOR" | "RECEIVED_FROM_VENDOR" | "IN_TRANSIT_TO" | "NONE" | "WASTE" | "UNLINKED_RETURN" | "COMPOSED" | "DECOMPOSED" | "SUPPORTED_BY_NEWER_VERSION" | "IN_TRANSIT";

/** Represents the transfer of a quantity of product inventory at a
particular time from one location to another. */
export type InventoryTransfer = {
  "id"?: string;
  "reference_id"?: string;
  "state"?: InventoryState;
  "from_location_id"?: string;
  "to_location_id"?: string;
  "catalog_object_id"?: string;
  "catalog_object_type"?: string;
  "quantity"?: string;
  "occurred_at"?: string;
  "created_at"?: string;
  "source"?: SourceApplication;
  "employee_id"?: string;
  "team_member_id"?: string;
};

/** Stores information about an invoice. You use the Invoices API to create and manage
invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). */
export type Invoice = {
  "id"?: string;
  "version"?: number;
  "location_id"?: string;
  "order_id"?: string;
  "primary_recipient"?: InvoiceRecipient;
  "payment_requests"?: Array<InvoicePaymentRequest>;
  "delivery_method"?: InvoiceDeliveryMethod;
  "invoice_number"?: string;
  "title"?: string;
  "description"?: string;
  "scheduled_at"?: string;
  "public_url"?: string;
  "next_payment_amount_money"?: Money;
  "status"?: InvoiceStatus;
  "timezone"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "accepted_payment_methods"?: InvoiceAcceptedPaymentMethods;
  "custom_fields"?: Array<InvoiceCustomField>;
  "subscription_id"?: string;
  "sale_or_service_date"?: string;
  "payment_conditions"?: string;
  "store_payment_method_enabled"?: boolean;
  "attachments"?: Array<InvoiceAttachment>;
  "creator_team_member_id"?: string;
};

/** The payment methods that customers can use to pay an [invoice](entity:Invoice) on the Square-hosted invoice payment page. */
export type InvoiceAcceptedPaymentMethods = {
  "card"?: boolean;
  "square_gift_card"?: boolean;
  "bank_account"?: boolean;
  "buy_now_pay_later"?: boolean;
  "cash_app_pay"?: boolean;
};

/** Represents a file attached to an [invoice](entity:Invoice). */
export type InvoiceAttachment = {
  "id"?: string;
  "filename"?: string;
  "description"?: string;
  "filesize"?: number;
  "hash"?: string;
  "mime_type"?: string;
  "uploaded_at"?: string;
};

/** Indicates the automatic payment method for an [invoice payment request](entity:InvoicePaymentRequest). */
export type InvoiceAutomaticPaymentSource = "NONE" | "CARD_ON_FILE" | "BANK_ON_FILE";

/** Published when an [Invoice](entity:Invoice) is canceled. */
export type InvoiceCanceledEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InvoiceCanceledEventData;
};

export type InvoiceCanceledEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: InvoiceCanceledEventObject;
};

export type InvoiceCanceledEventObject = {
  "invoice"?: Invoice;
};

/** Published when an [Invoice](entity:Invoice) is created. */
export type InvoiceCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InvoiceCreatedEventData;
};

export type InvoiceCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: InvoiceCreatedEventObject;
};

export type InvoiceCreatedEventObject = {
  "invoice"?: Invoice;
};

/** An additional seller-defined and customer-facing field to include on the invoice. For more information, 
see [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields).

Adding custom fields to an invoice requires an 
[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). */
export type InvoiceCustomField = {
  "label"?: string;
  "value"?: string;
  "placement"?: InvoiceCustomFieldPlacement;
};

/** Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF 
copies of the invoice. */
export type InvoiceCustomFieldPlacement = "ABOVE_LINE_ITEMS" | "BELOW_LINE_ITEMS";

/** Published when a draft [Invoice](entity:Invoice) is deleted. */
export type InvoiceDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InvoiceDeletedEventData;
};

export type InvoiceDeletedEventData = {
  "type"?: string;
  "id"?: string;
  "deleted"?: boolean;
};

/** Indicates how Square delivers the [invoice](entity:Invoice) to the customer. */
export type InvoiceDeliveryMethod = "EMAIL" | "SHARE_MANUALLY" | "SMS";

/** Describes query filters to apply. */
export type InvoiceFilter = {
  "location_ids": Array<string>;
  "customer_ids"?: Array<string>;
};

/** Published when a payment that is associated with an [invoice](entity:Invoice) is completed.
For more information about invoice payments, see [Pay an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#pay-invoice). */
export type InvoicePaymentMadeEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InvoicePaymentMadeEventData;
};

export type InvoicePaymentMadeEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: InvoicePaymentMadeEventObject;
};

export type InvoicePaymentMadeEventObject = {
  "invoice"?: Invoice;
};

/** Describes a payment request reminder (automatic notification) that Square sends
to the customer. You configure a reminder relative to the payment request
`due_date`. */
export type InvoicePaymentReminder = {
  "uid"?: string;
  "relative_scheduled_days"?: number;
  "message"?: string;
  "status"?: InvoicePaymentReminderStatus;
  "sent_at"?: string;
};

/** The status of a payment request reminder. */
export type InvoicePaymentReminderStatus = "PENDING" | "NOT_APPLICABLE" | "SENT";

/** Represents a payment request for an [invoice](entity:Invoice). Invoices can specify a maximum
of 13 payment requests, with up to 12 `INSTALLMENT` request types. For more information, 
see [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests).

Adding `INSTALLMENT` payment requests to an invoice requires an 
[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). */
export type InvoicePaymentRequest = {
  "uid"?: string;
  "request_method"?: InvoiceRequestMethod;
  "request_type"?: InvoiceRequestType;
  "due_date"?: string;
  "fixed_amount_requested_money"?: Money;
  "percentage_requested"?: string;
  "tipping_enabled"?: boolean;
  "automatic_payment_source"?: InvoiceAutomaticPaymentSource;
  "card_id"?: string;
  "reminders"?: Array<InvoicePaymentReminder>;
  "computed_amount_money"?: Money;
  "total_completed_amount_money"?: Money;
  "rounding_adjustment_included_money"?: Money;
};

/** Published when an [Invoice](entity:Invoice) transitions from a draft to a non-draft status. */
export type InvoicePublishedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InvoicePublishedEventData;
};

export type InvoicePublishedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: InvoicePublishedEventObject;
};

export type InvoicePublishedEventObject = {
  "invoice"?: Invoice;
};

/** Describes query criteria for searching invoices. */
export type InvoiceQuery = {
  "filter": InvoiceFilter;
  "sort"?: InvoiceSort;
};

/** Represents a snapshot of customer data. This object stores customer data that is displayed on the invoice 
and that Square uses to deliver the invoice.

When you provide a customer ID for a draft invoice, Square retrieves the associated customer profile and populates 
the remaining `InvoiceRecipient` fields. You cannot update these fields after the invoice is published. 
Square updates the customer ID in response to a merge operation, but does not update other fields. */
export type InvoiceRecipient = {
  "customer_id"?: string;
  "given_name"?: string;
  "family_name"?: string;
  "email_address"?: string;
  "address"?: Address;
  "phone_number"?: string;
  "company_name"?: string;
  "tax_ids"?: InvoiceRecipientTaxIds;
};

/** Represents the tax IDs for an invoice recipient. The country of the seller account determines 
whether the corresponding `tax_ids` field is available for the customer. For more information, 
see [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids). */
export type InvoiceRecipientTaxIds = {
  "eu_vat"?: string;
};

/** Published when a refund is applied toward a payment of an [invoice](entity:Invoice). 
For more information about invoice refunds, see [Refund an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#refund-invoice). */
export type InvoiceRefundedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InvoiceRefundedEventData;
};

export type InvoiceRefundedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: InvoiceRefundedEventObject;
};

export type InvoiceRefundedEventObject = {
  "invoice"?: Invoice;
};

/** Specifies the action for Square to take for processing the invoice. For example, 
email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at
version 2021-01-21. The corresponding `request_method` field is replaced by the
`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. */
export type InvoiceRequestMethod = "EMAIL" | "CHARGE_CARD_ON_FILE" | "SHARE_MANUALLY" | "CHARGE_BANK_ON_FILE" | "SMS" | "SMS_CHARGE_CARD_ON_FILE" | "SMS_CHARGE_BANK_ON_FILE";

/** Indicates the type of the payment request. For more information, see 
[Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). */
export type InvoiceRequestType = "BALANCE" | "DEPOSIT" | "INSTALLMENT";

/** Published when an automatic scheduled payment for an [Invoice](entity:Invoice) has failed. */
export type InvoiceScheduledChargeFailedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InvoiceScheduledChargeFailedEventData;
};

export type InvoiceScheduledChargeFailedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: InvoiceScheduledChargeFailedEventObject;
};

export type InvoiceScheduledChargeFailedEventObject = {
  "invoice"?: Invoice;
};

/** Identifies the sort field and sort order. */
export type InvoiceSort = {
  "field": InvoiceSortField;
  "order"?: SortOrder;
};

/** The field to use for sorting. */
export type InvoiceSortField = "INVOICE_SORT_DATE";

/** Indicates the status of an [invoice](entity:Invoice). */
export type InvoiceStatus = "DRAFT" | "UNPAID" | "SCHEDULED" | "PARTIALLY_PAID" | "PAID" | "PARTIALLY_REFUNDED" | "REFUNDED" | "CANCELED" | "FAILED" | "PAYMENT_PENDING";

/** Published when an [Invoice](entity:Invoice) is updated. */
export type InvoiceUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: InvoiceUpdatedEventData;
};

export type InvoiceUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: InvoiceUpdatedEventObject;
};

export type InvoiceUpdatedEventObject = {
  "invoice"?: Invoice;
};

/** Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`. */
export type ItemVariationLocationOverrides = {
  "location_id"?: string;
  "price_money"?: Money;
  "pricing_type"?: CatalogPricingType;
  "track_inventory"?: boolean;
  "inventory_alert_type"?: InventoryAlertType;
  "inventory_alert_threshold"?: number;
  "sold_out"?: boolean;
  "sold_out_valid_until"?: string;
};

/** Represents a job that can be assigned to [team members](entity:TeamMember). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](entity:JobAssignment)
in a team member's wage setting. */
export type Job = {
  "id"?: string;
  "title"?: string;
  "is_tip_eligible"?: boolean;
  "created_at"?: string;
  "updated_at"?: string;
  "version"?: number;
};

/** Represents a job assigned to a [team member](entity:TeamMember), including the compensation the team
member earns for the job. Job assignments are listed in the team member's [wage setting](entity:WageSetting). */
export type JobAssignment = {
  "job_title"?: string;
  "pay_type": JobAssignmentPayType;
  "hourly_rate"?: Money;
  "annual_rate"?: Money;
  "weekly_hours"?: number;
  "job_id"?: string;
};

/** Enumerates the possible pay types that a job can be assigned. */
export type JobAssignmentPayType = "NONE" | "HOURLY" | "SALARY";

/** Published when a Job is created. */
export type JobCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: JobCreatedEventData;
};

export type JobCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: JobCreatedEventObject;
};

export type JobCreatedEventObject = {
  "job"?: Job;
};

/** Published when a Job is updated. */
export type JobUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: JobUpdatedEventData;
};

export type JobUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: JobUpdatedEventObject;
};

export type JobUpdatedEventObject = {
  "job"?: Job;
};

/** Published when a [ScheduledShift](entity:ScheduledShift) is created. */
export type LaborScheduledShiftCreatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborScheduledShiftCreatedEventData;
};

export type LaborScheduledShiftCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LaborScheduledShiftCreatedEventObject;
};

export type LaborScheduledShiftCreatedEventObject = {
  "ScheduledShift"?: ScheduledShift;
};

/** Published when a [ScheduledShift](entity:ScheduledShift) is deleted. */
export type LaborScheduledShiftDeletedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborScheduledShiftDeletedEventData;
};

export type LaborScheduledShiftDeletedEventData = {
  "type"?: string;
  "id"?: string;
  "deleted"?: boolean;
};

/** Published when a [ScheduledShift](entity:ScheduledShift) is published. */
export type LaborScheduledShiftPublishedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborScheduledShiftPublishedEventData;
};

export type LaborScheduledShiftPublishedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LaborScheduledShiftPublishedEventObject;
};

export type LaborScheduledShiftPublishedEventObject = {
  "ScheduledShift"?: ScheduledShift;
};

/** Published when a [ScheduledShift](entity:ScheduledShift) is updated. */
export type LaborScheduledShiftUpdatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborScheduledShiftUpdatedEventData;
};

export type LaborScheduledShiftUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LaborScheduledShiftUpdatedEventObject;
};

export type LaborScheduledShiftUpdatedEventObject = {
  "ScheduledShift"?: ScheduledShift;
};

/** Published when a worker starts a [Shift](entity:Shift).

Deprecated at Square API version 2025-05-21. Replaced by `labor.timecard.created`. */
export type LaborShiftCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborShiftCreatedEventData;
};

export type LaborShiftCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LaborShiftCreatedEventObject;
};

export type LaborShiftCreatedEventObject = {
  "shift"?: Shift;
};

/** Published when a [Shift](entity:Shift) is deleted.

Deprecated at Square API version 2025-05-21. Replaced by `labor.timecard.deleted`. */
export type LaborShiftDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborShiftDeletedEventData;
};

export type LaborShiftDeletedEventData = {
  "type"?: string;
  "id"?: string;
  "deleted"?: boolean;
};

/** Published when a [Shift](entity:Shift) is updated.

Deprecated at Square API version 2025-05-21. Replaced by `labor.timecard.updated`. */
export type LaborShiftUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborShiftUpdatedEventData;
};

export type LaborShiftUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LaborShiftUpdatedEventObject;
};

export type LaborShiftUpdatedEventObject = {
  "shift"?: Shift;
};

/** Published when a worker starts a [Timecard](entity:Timecard). */
export type LaborTimecardCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborTimecardCreatedEventData;
};

export type LaborTimecardCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LaborTimecardCreatedEventObject;
};

export type LaborTimecardCreatedEventObject = {
  "timecard"?: Timecard;
};

/** Published when a [Timecard](entity:Timecard) is deleted. */
export type LaborTimecardDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborTimecardDeletedEventData;
};

export type LaborTimecardDeletedEventData = {
  "type"?: string;
  "id"?: string;
  "deleted"?: boolean;
};

/** Published when a [Timecard](entity:Timecard) is updated. */
export type LaborTimecardUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LaborTimecardUpdatedEventData;
};

export type LaborTimecardUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LaborTimecardUpdatedEventObject;
};

export type LaborTimecardUpdatedEventObject = {
  "timecard"?: Timecard;
};

/** Additional details about `WALLET` type payments with the `brand` of `LIGHTNING`. */
export type LightningDetails = {
  "payment_url"?: string;
};

/** A request to link a customer to a gift card. */
export type LinkCustomerToGiftCardRequest = {
  "customer_id": string;
};

/** A response that contains the linked `GiftCard` object. If the request resulted in errors, 
the response contains a set of `Error` objects. */
export type LinkCustomerToGiftCardResponse = {
  "errors"?: Array<Error>;
  "gift_card"?: GiftCard;
};

/** Response object returned by ListBankAccounts. */
export type ListBankAccountsResponse = {
  "bank_accounts"?: Array<BankAccount>;
  "errors"?: Array<Error>;
  "cursor"?: string;
};

/** Represents a [ListBookingCustomAttributeDefinitions](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributeDefinitions) response.
Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response.
If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. */
export type ListBookingCustomAttributeDefinitionsResponse = {
  "custom_attribute_definitions"?: Array<CustomAttributeDefinition>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a [ListBookingCustomAttributes](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributes) response.
Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional
results are available, the `cursor` field is also present along with `custom_attributes`. */
export type ListBookingCustomAttributesResponse = {
  "custom_attributes"?: Array<CustomAttribute>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

export type ListBookingsResponse = {
  "bookings"?: Array<Booking>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** The response to a request for a set of `BreakType` objects. The response contains
the requested `BreakType` objects and might contain a set of `Error` objects if
the request resulted in errors. */
export type ListBreakTypesResponse = {
  "break_types"?: Array<BreakType>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [ListCards](api-endpoint:Cards-ListCards) endpoint.

Note: if there are errors processing the request, the card field will not be
present. */
export type ListCardsResponse = {
  "errors"?: Array<Error>;
  "cards"?: Array<Card>;
  "cursor"?: string;
};

export type ListCashDrawerShiftEventsResponse = {
  "cursor"?: string;
  "errors"?: Array<Error>;
  "cash_drawer_shift_events"?: Array<CashDrawerShiftEvent>;
};

export type ListCashDrawerShiftsResponse = {
  "cursor"?: string;
  "errors"?: Array<Error>;
  "cash_drawer_shifts"?: Array<CashDrawerShiftSummary>;
};

export type ListCatalogResponse = {
  "errors"?: Array<Error>;
  "cursor"?: string;
  "objects"?: Array<CatalogObject>;
};

export type ListChannelsRequestConstants = "MAX_PAGE_SIZE";

export type ListChannelsResponse = {
  "errors"?: Array<Error>;
  "channels"?: Array<Channel>;
  "cursor"?: string;
};

/** Represents a [ListCustomerCustomAttributeDefinitions](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributeDefinitions) response.
Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response.
If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. */
export type ListCustomerCustomAttributeDefinitionsResponse = {
  "custom_attribute_definitions"?: Array<CustomAttributeDefinition>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) response.
Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional
results are available, the `cursor` field is also present along with `custom_attributes`. */
export type ListCustomerCustomAttributesResponse = {
  "custom_attributes"?: Array<CustomAttribute>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [ListCustomerGroups](api-endpoint:CustomerGroups-ListCustomerGroups) endpoint.

Either `errors` or `groups` is present in a given response (never both). */
export type ListCustomerGroupsResponse = {
  "errors"?: Array<Error>;
  "groups"?: Array<CustomerGroup>;
  "cursor"?: string;
};

/** Defines the fields that are included in the response body for requests to the `ListCustomerSegments` endpoint.

Either `errors` or `segments` is present in a given response (never both). */
export type ListCustomerSegmentsResponse = {
  "errors"?: Array<Error>;
  "segments"?: Array<CustomerSegment>;
  "cursor"?: string;
};

/** 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). */
export type ListCustomersResponse = {
  "errors"?: Array<Error>;
  "customers"?: Array<Customer>;
  "cursor"?: string;
  "count"?: number;
};

export type ListDeviceCodesResponse = {
  "errors"?: Array<Error>;
  "device_codes"?: Array<DeviceCode>;
  "cursor"?: string;
};

export type ListDevicesResponse = {
  "errors"?: Array<Error>;
  "devices"?: Array<Device>;
  "cursor"?: string;
};

/** Defines the fields in a `ListDisputeEvidence` response. */
export type ListDisputeEvidenceResponse = {
  "evidence"?: Array<DisputeEvidence>;
  "errors"?: Array<Error>;
  "cursor"?: string;
};

/** Defines fields in a `ListDisputes` response. */
export type ListDisputesResponse = {
  "errors"?: Array<Error>;
  "disputes"?: Array<Dispute>;
  "cursor"?: string;
};

/** The response to a request for a set of `EmployeeWage` objects. The response contains
a set of `EmployeeWage` objects. */
export type ListEmployeeWagesResponse = {
  "employee_wages"?: Array<EmployeeWage>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

export type ListEmployeesResponse = {
  "employees"?: Array<Employee>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [ListEventTypes](api-endpoint:Events-ListEventTypes) endpoint.

Note: if there are errors processing the request, the event types field will not be
present. */
export type ListEventTypesResponse = {
  "errors"?: Array<Error>;
  "event_types"?: Array<string>;
  "metadata"?: Array<EventTypeMetadata>;
};

/** A response that contains a list of `GiftCardActivity` objects. If the request resulted in errors, 
the response contains a set of `Error` objects. */
export type ListGiftCardActivitiesResponse = {
  "errors"?: Array<Error>;
  "gift_card_activities"?: Array<GiftCardActivity>;
  "cursor"?: string;
};

/** A response that contains a list of `GiftCard` objects. If the request resulted in errors, 
the response contains a set of `Error` objects. */
export type ListGiftCardsResponse = {
  "errors"?: Array<Error>;
  "gift_cards"?: Array<GiftCard>;
  "cursor"?: string;
};

/** Describes a `ListInvoice` response. */
export type ListInvoicesResponse = {
  "invoices"?: Array<Invoice>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either `jobs` or `errors`
is present in the response. If additional results are available, the `cursor` field is also present. */
export type ListJobsResponse = {
  "jobs"?: Array<Job>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

export type ListLocationBookingProfilesResponse = {
  "location_booking_profiles"?: Array<LocationBookingProfile>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a [ListLocationCustomAttributeDefinitions](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributeDefinitions) response.
Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response.
If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. */
export type ListLocationCustomAttributeDefinitionsResponse = {
  "custom_attribute_definitions"?: Array<CustomAttributeDefinition>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a [ListLocationCustomAttributes](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributes) response.
Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional
results are available, the `cursor` field is also present along with `custom_attributes`. */
export type ListLocationCustomAttributesResponse = {
  "custom_attributes"?: Array<CustomAttribute>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of a request
to the [ListLocations](api-endpoint:Locations-ListLocations) endpoint.

Either `errors` or `locations` is present in a given response (never both). */
export type ListLocationsResponse = {
  "errors"?: Array<Error>;
  "locations"?: Array<Location>;
};

/** A response that contains all loyalty programs. */
export type ListLoyaltyProgramsResponse = {
  "errors"?: Array<Error>;
  "programs"?: Array<LoyaltyProgram>;
};

/** Represents a [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) response.
One of `loyalty_promotions`, an empty object, or `errors` is present in the response.
If additional results are available, the `cursor` field is also present along with `loyalty_promotions`. */
export type ListLoyaltyPromotionsResponse = {
  "errors"?: Array<Error>;
  "loyalty_promotions"?: Array<LoyaltyPromotion>;
  "cursor"?: string;
};

/** Represents a [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) response.
Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response.
If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. */
export type ListMerchantCustomAttributeDefinitionsResponse = {
  "custom_attribute_definitions"?: Array<CustomAttributeDefinition>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) response.
Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional
results are available, the `cursor` field is also present along with `custom_attributes`. */
export type ListMerchantCustomAttributesResponse = {
  "custom_attributes"?: Array<CustomAttribute>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** The response object returned by the [ListMerchant](api-endpoint:Merchants-ListMerchants) endpoint. */
export type ListMerchantsResponse = {
  "errors"?: Array<Error>;
  "merchant"?: Array<Merchant>;
  "cursor"?: number;
};

/** Represents a response from listing order custom attribute definitions. */
export type ListOrderCustomAttributeDefinitionsResponse = {
  "custom_attribute_definitions": Array<CustomAttributeDefinition>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a response from listing order custom attributes. */
export type ListOrderCustomAttributesResponse = {
  "custom_attributes"?: Array<CustomAttribute>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

export type ListPaymentLinksResponse = {
  "errors"?: Array<Error>;
  "payment_links"?: Array<PaymentLink>;
  "cursor"?: string;
};

export type ListPaymentRefundsRequestSortField = "CREATED_AT" | "UPDATED_AT";

/** Defines the response returned by [ListPaymentRefunds](api-endpoint:Refunds-ListPaymentRefunds).

Either `errors` or `refunds` is present in a given response (never both). */
export type ListPaymentRefundsResponse = {
  "errors"?: Array<Error>;
  "refunds"?: Array<PaymentRefund>;
  "cursor"?: string;
};

export type ListPaymentsRequestSortField = "CREATED_AT" | "OFFLINE_CREATED_AT" | "UPDATED_AT";

/** Defines the response returned by [ListPayments](api-endpoint:Payments-ListPayments). */
export type ListPaymentsResponse = {
  "errors"?: Array<Error>;
  "payments"?: Array<Payment>;
  "cursor"?: string;
};

/** The response to retrieve payout records entries. */
export type ListPayoutEntriesResponse = {
  "payout_entries"?: Array<PayoutEntry>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** The response to retrieve payout records entries. */
export type ListPayoutsResponse = {
  "payouts"?: Array<Payout>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a `ListSites` response. The response can include either `sites` or `errors`. */
export type ListSitesResponse = {
  "errors"?: Array<Error>;
  "sites"?: Array<Site>;
};

/** Defines output parameters in a response from the
[ListSubscriptionEvents](api-endpoint:Subscriptions-ListSubscriptionEvents). */
export type ListSubscriptionEventsResponse = {
  "errors"?: Array<Error>;
  "subscription_events"?: Array<SubscriptionEvent>;
  "cursor"?: string;
};

export type ListTeamMemberBookingProfilesResponse = {
  "team_member_booking_profiles"?: Array<TeamMemberBookingProfile>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** The response to a request for a set of `TeamMemberWage` objects. The response contains
a set of `TeamMemberWage` objects. */
export type ListTeamMemberWagesResponse = {
  "team_member_wages"?: Array<TeamMemberWage>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [ListTransactions](api-endpoint:Transactions-ListTransactions) endpoint.

One of `errors` or `transactions` is present in a given response (never both). */
export type ListTransactionsResponse = {
  "errors"?: Array<Error>;
  "transactions"?: Array<Transaction>;
  "cursor"?: string;
};

/** Defines the fields that are included in the response body of
a request to the [ListWebhookEventTypes](api-endpoint:WebhookSubscriptions-ListWebhookEventTypes) endpoint.

Note: if there are errors processing the request, the event types field will not be
present. */
export type ListWebhookEventTypesResponse = {
  "errors"?: Array<Error>;
  "event_types"?: Array<string>;
  "metadata"?: Array<EventTypeMetadata>;
};

/** Defines the fields that are included in the response body of
a request to the [ListWebhookSubscriptions](api-endpoint:WebhookSubscriptions-ListWebhookSubscriptions) endpoint.

Note: if there are errors processing the request, the subscriptions field will not be
present. */
export type ListWebhookSubscriptionsResponse = {
  "errors"?: Array<Error>;
  "subscriptions"?: Array<WebhookSubscription>;
  "cursor"?: string;
};

/** The response to a request for a set of `WorkweekConfig` objects. The response contains
the requested `WorkweekConfig` objects and might contain a set of `Error` objects if
the request resulted in errors. */
export type ListWorkweekConfigsResponse = {
  "workweek_configs"?: Array<WorkweekConfig>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). */
export type Location = {
  "id"?: string;
  "name"?: string;
  "address"?: Address;
  "timezone"?: string;
  "capabilities"?: Array<LocationCapability>;
  "status"?: LocationStatus;
  "created_at"?: string;
  "merchant_id"?: string;
  "country"?: Country;
  "language_code"?: string;
  "currency"?: Currency;
  "phone_number"?: string;
  "business_name"?: string;
  "type"?: LocationType;
  "website_url"?: string;
  "business_hours"?: BusinessHours;
  "business_email"?: string;
  "description"?: string;
  "twitter_username"?: string;
  "instagram_username"?: string;
  "facebook_url"?: string;
  "coordinates"?: Coordinates;
  "logo_url"?: string;
  "pos_background_url"?: string;
  "mcc"?: string;
  "full_format_logo_url"?: string;
  "tax_ids"?: TaxIds;
};

/** The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking. */
export type LocationBookingProfile = {
  "location_id"?: string;
  "booking_site_url"?: string;
  "online_booking_enabled"?: boolean;
};

/** The capabilities a location might have. */
export type LocationCapability = "CREDIT_CARD_PROCESSING" | "AUTOMATIC_TRANSFERS" | "UNLINKED_REFUNDS";

/** Published when a [Location](entity:Location) is created. */
export type LocationCreatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LocationCreatedEventData;
};

export type LocationCreatedEventData = {
  "type"?: string;
  "id"?: string;
};

/** Published when a location [custom attribute definition](entity:CustomAttributeDefinition)
is created by the subscribing application. */
export type LocationCustomAttributeDefinitionOwnedCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a location [custom attribute definition](entity:CustomAttributeDefinition) 
created by the subscribing application is deleted. A custom attribute definition can only be deleted by 
the application that created it. */
export type LocationCustomAttributeDefinitionOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a location [custom attribute definition](entity:CustomAttributeDefinition) 
created by the subscribing application is updated. A custom attribute definition can only be updated 
by the application that created it. */
export type LocationCustomAttributeDefinitionOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a location [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to the subscribing application is created. A notification is sent when your application 
creates a custom attribute definition or another application creates a custom attribute definition whose
`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type LocationCustomAttributeDefinitionVisibleCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a location [custom attribute definition](entity:CustomAttributeDefinition) 
that is visible to the subscribing application is deleted. A custom attribute definition can only 
be deleted by the application that created it. A notification is sent when your application deletes 
a custom attribute definition or when another application deletes a custom attribute definition whose 
`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type LocationCustomAttributeDefinitionVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a location [custom attribute definition](entity:CustomAttributeDefinition) 
that is visible to the subscribing application is updated. A custom attribute definition can only be updated
by the application that created it. A notification is sent when your application updates a custom attribute 
definition or when another application updates a custom attribute definition whose `visibility` is 
`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type LocationCustomAttributeDefinitionVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a location [custom attribute](entity:CustomAttribute) 
owned by the subscribing application is deleted. Custom attributes are owned by the
application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).
Custom attributes whose `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application. */
export type LocationCustomAttributeOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a location [custom attribute](entity:CustomAttribute) owned by the
subscribing application is created or updated. Custom attributes are owned by the application that created
the corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose
`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application. */
export type LocationCustomAttributeOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a location [custom attribute](entity:CustomAttribute) that is visible to the
subscribing application is deleted. A notification is sent when:
- Your application deletes a custom attribute owned by your application, regardless of the `visibility` setting.
- Any application deletes a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`
or `VISIBILITY_READ_WRITE_VALUES`.

Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application, but those set to
`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the owner. Custom attributes are owned
by the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). */
export type LocationCustomAttributeVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a location [custom attribute](entity:CustomAttribute) that is visible
to the subscribing application is created or updated. A notification is sent when:
- Your application creates or updates a custom attribute owned by your application, regardless of the `visibility` setting.
- Any application creates or updates a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`
or `VISIBILITY_READ_WRITE_VALUES`.

Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application, but those set to
`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or updated by the owner. Custom attributes are owned
by the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). */
export type LocationCustomAttributeVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when online checkout location settings are updated */
export type LocationSettingsUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LocationSettingsUpdatedEventData;
};

export type LocationSettingsUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LocationSettingsUpdatedEventObject;
};

export type LocationSettingsUpdatedEventObject = {
  "location_settings"?: CheckoutLocationSettings;
};

/** A location's status. */
export type LocationStatus = "ACTIVE" | "INACTIVE";

/** A location's type. */
export type LocationType = "PHYSICAL" | "MOBILE";

/** Published when a [Location](entity:Location) is updated. */
export type LocationUpdatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LocationUpdatedEventData;
};

export type LocationUpdatedEventData = {
  "type"?: string;
  "id"?: string;
};

/** Describes a loyalty account in a [loyalty program](entity:LoyaltyProgram). For more information, see
[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). */
export type LoyaltyAccount = {
  "id"?: string;
  "program_id": string;
  "balance"?: number;
  "lifetime_points"?: number;
  "customer_id"?: string;
  "enrolled_at"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "mapping"?: LoyaltyAccountMapping;
  "expiring_point_deadlines"?: Array<LoyaltyAccountExpiringPointDeadline>;
};

/** Published when a [loyalty account](entity:LoyaltyAccount) is created. */
export type LoyaltyAccountCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LoyaltyAccountCreatedEventData;
};

/** The data associated with a `loyalty.account.created` event. */
export type LoyaltyAccountCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LoyaltyAccountCreatedEventObject;
};

export type LoyaltyAccountCreatedEventObject = {
  "loyalty_account"?: LoyaltyAccount;
};

/** Published when a [loyalty account](entity:LoyaltyAccount) is deleted. */
export type LoyaltyAccountDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LoyaltyAccountDeletedEventData;
};

/** The data associated with a `loyalty.account.deleted` event. */
export type LoyaltyAccountDeletedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LoyaltyAccountDeletedEventObject;
};

export type LoyaltyAccountDeletedEventObject = {
  "loyalty_account"?: LoyaltyAccount;
};

/** Represents a set of points for a loyalty account that are scheduled to expire on a specific date. */
export type LoyaltyAccountExpiringPointDeadline = {
  "points": number;
  "expires_at": string;
};

/** Represents the mapping that associates a loyalty account with a buyer. 

Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, see 
[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). */
export type LoyaltyAccountMapping = {
  "id"?: string;
  "created_at"?: string;
  "phone_number"?: string;
};

/** The type of mapping. */
export type LoyaltyAccountMappingType = "PHONE";

/** Published when a [loyalty account](entity:LoyaltyAccount) is updated. */
export type LoyaltyAccountUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LoyaltyAccountUpdatedEventData;
};

/** The data associated with a `loyalty.account.updated` event. */
export type LoyaltyAccountUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LoyaltyAccountUpdatedEventObject;
};

export type LoyaltyAccountUpdatedEventObject = {
  "loyalty_account"?: LoyaltyAccount;
};

/** Provides information about a loyalty event. 
For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). */
export type LoyaltyEvent = {
  "id": string;
  "type": LoyaltyEventType;
  "created_at": string;
  "accumulate_points"?: LoyaltyEventAccumulatePoints;
  "create_reward"?: LoyaltyEventCreateReward;
  "redeem_reward"?: LoyaltyEventRedeemReward;
  "delete_reward"?: LoyaltyEventDeleteReward;
  "adjust_points"?: LoyaltyEventAdjustPoints;
  "loyalty_account_id": string;
  "location_id"?: string;
  "source": LoyaltyEventSource;
  "expire_points"?: LoyaltyEventExpirePoints;
  "other_event"?: LoyaltyEventOther;
  "accumulate_promotion_points"?: LoyaltyEventAccumulatePromotionPoints;
};

/** Provides metadata when the event `type` is `ACCUMULATE_POINTS`. */
export type LoyaltyEventAccumulatePoints = {
  "loyalty_program_id"?: string;
  "points"?: number;
  "order_id"?: string;
};

/** Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. */
export type LoyaltyEventAccumulatePromotionPoints = {
  "loyalty_program_id"?: string;
  "loyalty_promotion_id"?: string;
  "points": number;
  "order_id": string;
};

/** Provides metadata when the event `type` is `ADJUST_POINTS`. */
export type LoyaltyEventAdjustPoints = {
  "loyalty_program_id"?: string;
  "points": number;
  "reason"?: string;
};

/** Provides metadata when the event `type` is `CREATE_REWARD`. */
export type LoyaltyEventCreateReward = {
  "loyalty_program_id": string;
  "reward_id"?: string;
  "points": number;
};

/** Published when a [loyalty event](entity:LoyaltyEvent) is created. */
export type LoyaltyEventCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LoyaltyEventCreatedEventData;
};

/** The data associated with a `loyalty.event.created` event. */
export type LoyaltyEventCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LoyaltyEventCreatedEventObject;
};

export type LoyaltyEventCreatedEventObject = {
  "loyalty_event"?: LoyaltyEvent;
};

/** Filter events by date time range. */
export type LoyaltyEventDateTimeFilter = {
  "created_at": TimeRange;
};

/** Provides metadata when the event `type` is `DELETE_REWARD`. */
export type LoyaltyEventDeleteReward = {
  "loyalty_program_id": string;
  "reward_id"?: string;
  "points": number;
};

/** Provides metadata when the event `type` is `EXPIRE_POINTS`. */
export type LoyaltyEventExpirePoints = {
  "loyalty_program_id": string;
  "points": number;
};

/** The filtering criteria. If the request specifies multiple filters, 
the endpoint uses a logical AND to evaluate them. */
export type LoyaltyEventFilter = {
  "loyalty_account_filter"?: LoyaltyEventLoyaltyAccountFilter;
  "type_filter"?: LoyaltyEventTypeFilter;
  "date_time_filter"?: LoyaltyEventDateTimeFilter;
  "location_filter"?: LoyaltyEventLocationFilter;
  "order_filter"?: LoyaltyEventOrderFilter;
};

/** Filter events by location. */
export type LoyaltyEventLocationFilter = {
  "location_ids": Array<string>;
};

/** Filter events by loyalty account. */
export type LoyaltyEventLoyaltyAccountFilter = {
  "loyalty_account_id": string;
};

/** Filter events by the order associated with the event. */
export type LoyaltyEventOrderFilter = {
  "order_id": string;
};

/** Provides metadata when the event `type` is `OTHER`. */
export type LoyaltyEventOther = {
  "loyalty_program_id": string;
  "points": number;
};

/** Represents a query used to search for loyalty events. */
export type LoyaltyEventQuery = {
  "filter"?: LoyaltyEventFilter;
};

/** Provides metadata when the event `type` is `REDEEM_REWARD`. */
export type LoyaltyEventRedeemReward = {
  "loyalty_program_id": string;
  "reward_id"?: string;
  "order_id"?: string;
};

/** Defines whether the event was generated by the Square Point of Sale. */
export type LoyaltyEventSource = "SQUARE" | "LOYALTY_API";

/** The type of the loyalty event. */
export type LoyaltyEventType = "ACCUMULATE_POINTS" | "CREATE_REWARD" | "REDEEM_REWARD" | "DELETE_REWARD" | "ADJUST_POINTS" | "EXPIRE_POINTS" | "OTHER" | "ACCUMULATE_PROMOTION_POINTS";

/** Filter events by event type. */
export type LoyaltyEventTypeFilter = {
  "types": Array<LoyaltyEventType>;
};

/** Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem points for rewards. 
Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. 
For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). */
export type LoyaltyProgram = {
  "id"?: string;
  "status"?: LoyaltyProgramStatus;
  "reward_tiers"?: Array<LoyaltyProgramRewardTier>;
  "expiration_policy"?: LoyaltyProgramExpirationPolicy;
  "terminology"?: LoyaltyProgramTerminology;
  "location_ids"?: Array<string>;
  "created_at"?: string;
  "updated_at"?: string;
  "accrual_rules"?: Array<LoyaltyProgramAccrualRule>;
};

/** Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](entity:LoyaltyProgram). */
export type LoyaltyProgramAccrualRule = {
  "accrual_type": LoyaltyProgramAccrualRuleType;
  "points"?: number;
  "visit_data"?: LoyaltyProgramAccrualRuleVisitData;
  "spend_data"?: LoyaltyProgramAccrualRuleSpendData;
  "item_variation_data"?: LoyaltyProgramAccrualRuleItemVariationData;
  "category_data"?: LoyaltyProgramAccrualRuleCategoryData;
};

/** Represents additional data for rules with the `CATEGORY` accrual type. */
export type LoyaltyProgramAccrualRuleCategoryData = {
  "category_id": string;
};

/** Represents additional data for rules with the `ITEM_VARIATION` accrual type. */
export type LoyaltyProgramAccrualRuleItemVariationData = {
  "item_variation_id": string;
};

/** Represents additional data for rules with the `SPEND` accrual type. */
export type LoyaltyProgramAccrualRuleSpendData = {
  "amount_money": Money;
  "excluded_category_ids"?: Array<string>;
  "excluded_item_variation_ids"?: Array<string>;
  "tax_mode": LoyaltyProgramAccrualRuleTaxMode;
};

/** Indicates how taxes should be treated when calculating the purchase amount used for loyalty points accrual. 
This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum spend requirement. */
export type LoyaltyProgramAccrualRuleTaxMode = "BEFORE_TAX" | "AFTER_TAX";

/** The type of the accrual rule that defines how buyers can earn points. */
export type LoyaltyProgramAccrualRuleType = "VISIT" | "SPEND" | "ITEM_VARIATION" | "CATEGORY";

/** Represents additional data for rules with the `VISIT` accrual type. */
export type LoyaltyProgramAccrualRuleVisitData = {
  "minimum_amount_money"?: Money;
  "tax_mode": LoyaltyProgramAccrualRuleTaxMode;
};

/** Published when a [loyalty program](entity:LoyaltyProgram) is created. */
export type LoyaltyProgramCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LoyaltyProgramCreatedEventData;
};

/** The data associated with a `loyalty.program.created` event. */
export type LoyaltyProgramCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LoyaltyProgramCreatedEventObject;
};

/** An object that contains the loyalty program associated with a `loyalty.program.created` event. */
export type LoyaltyProgramCreatedEventObject = {
  "loyalty_program"?: LoyaltyProgram;
};

/** Describes when the loyalty program expires. */
export type LoyaltyProgramExpirationPolicy = {
  "expiration_duration": string;
};

/** Represents a reward tier in a loyalty program. A reward tier defines how buyers can redeem points for a reward, such as the number of points required and the value and scope of the discount. A loyalty program can offer multiple reward tiers. */
export type LoyaltyProgramRewardTier = {
  "id"?: string;
  "points": number;
  "name"?: string;
  "created_at"?: string;
  "pricing_rule_reference": CatalogObjectReference;
};

/** Indicates whether the program is currently active. */
export type LoyaltyProgramStatus = "INACTIVE" | "ACTIVE";

/** Represents the naming used for loyalty points. */
export type LoyaltyProgramTerminology = {
  "one": string;
  "other": string;
};

/** Published when a [loyalty program](entity:LoyaltyProgram) is updated. */
export type LoyaltyProgramUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LoyaltyProgramUpdatedEventData;
};

/** The data associated with a `loyalty.program.updated` event. */
export type LoyaltyProgramUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LoyaltyProgramUpdatedEventObject;
};

/** An object that contains the loyalty program associated with a `loyalty.program.updated` event. */
export type LoyaltyProgramUpdatedEventObject = {
  "loyalty_program"?: LoyaltyProgram;
};

/** Represents a promotion for a [loyalty program](entity:LoyaltyProgram). Loyalty promotions enable buyers
to earn extra points on top of those earned from the base program.

A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. */
export type LoyaltyPromotion = {
  "id"?: string;
  "name": string;
  "incentive": LoyaltyPromotionIncentive;
  "available_time": LoyaltyPromotionAvailableTimeData;
  "trigger_limit"?: LoyaltyPromotionTriggerLimit;
  "status"?: LoyaltyPromotionStatus;
  "created_at"?: string;
  "canceled_at"?: string;
  "updated_at"?: string;
  "loyalty_program_id"?: string;
  "minimum_spend_amount_money"?: Money;
  "qualifying_item_variation_ids"?: Array<string>;
  "qualifying_category_ids"?: Array<string>;
};

/** Represents scheduling information that determines when purchases can qualify to earn points
from a [loyalty promotion](entity:LoyaltyPromotion). */
export type LoyaltyPromotionAvailableTimeData = {
  "start_date"?: string;
  "end_date"?: string;
  "time_periods": Array<string>;
};

/** Published when a [loyalty promotion](entity:LoyaltyPromotion) is created. */
export type LoyaltyPromotionCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LoyaltyPromotionCreatedEventData;
};

/** The data associated with a `loyalty.promotion.created` event. */
export type LoyaltyPromotionCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LoyaltyPromotionCreatedEventObject;
};

/** An object that contains the loyalty promotion associated with a `loyalty.promotion.created` event. */
export type LoyaltyPromotionCreatedEventObject = {
  "loyalty_promotion"?: LoyaltyPromotion;
};

/** Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) are calculated,
either by multiplying the points earned from the base program or by adding a specified number
of points to the points earned from the base program. */
export type LoyaltyPromotionIncentive = {
  "type": LoyaltyPromotionIncentiveType;
  "points_multiplier_data"?: LoyaltyPromotionIncentivePointsMultiplierData;
  "points_addition_data"?: LoyaltyPromotionIncentivePointsAdditionData;
};

/** Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive). */
export type LoyaltyPromotionIncentivePointsAdditionData = {
  "points_addition": number;
};

/** Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive). */
export type LoyaltyPromotionIncentivePointsMultiplierData = {
  "points_multiplier"?: number;
  "multiplier"?: string;
};

/** Indicates the type of points incentive for a [loyalty promotion](entity:LoyaltyPromotion),
which is used to determine how buyers can earn points from the promotion. */
export type LoyaltyPromotionIncentiveType = "POINTS_MULTIPLIER" | "POINTS_ADDITION";

/** Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion). */
export type LoyaltyPromotionStatus = "ACTIVE" | "ENDED" | "CANCELED" | "SCHEDULED";

/** Represents the number of times a buyer can earn points during a [loyalty promotion](entity:LoyaltyPromotion).
If this field is not set, buyers can trigger the promotion an unlimited number of times to earn points during
the time that the promotion is available.

A purchase that is disqualified from earning points because of this limit might qualify for another active promotion. */
export type LoyaltyPromotionTriggerLimit = {
  "times": number;
  "interval"?: LoyaltyPromotionTriggerLimitInterval;
};

/** Indicates the time period that the [trigger limit](entity:LoyaltyPromotionTriggerLimit) applies to,
which is used to determine the number of times a buyer can earn points for a [loyalty promotion](entity:LoyaltyPromotion). */
export type LoyaltyPromotionTriggerLimitInterval = "ALL_TIME" | "DAY";

/** Published when a [loyalty promotion](entity:LoyaltyPromotion) is updated. This event is
invoked only when a loyalty promotion is canceled. */
export type LoyaltyPromotionUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: LoyaltyPromotionUpdatedEventData;
};

/** The data associated with a `loyalty.promotion.updated` event. */
export type LoyaltyPromotionUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: LoyaltyPromotionUpdatedEventObject;
};

/** An object that contains the loyalty promotion associated with a `loyalty.promotion.updated` event. */
export type LoyaltyPromotionUpdatedEventObject = {
  "loyalty_promotion"?: LoyaltyPromotion;
};

/** Represents a contract to redeem loyalty points for a [reward tier](entity:LoyaltyProgramRewardTier) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. 
For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards). */
export type LoyaltyReward = {
  "id"?: string;
  "status"?: LoyaltyRewardStatus;
  "loyalty_account_id": string;
  "reward_tier_id": string;
  "points"?: number;
  "order_id"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "redeemed_at"?: string;
};

/** The status of the loyalty reward. */
export type LoyaltyRewardStatus = "ISSUED" | "REDEEMED" | "DELETED";

/** 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`. */
export type MeasurementUnit = {
  "custom_unit"?: MeasurementUnitCustom;
  "area_unit"?: MeasurementUnitArea;
  "length_unit"?: MeasurementUnitLength;
  "volume_unit"?: MeasurementUnitVolume;
  "weight_unit"?: MeasurementUnitWeight;
  "generic_unit"?: MeasurementUnitGeneric;
  "time_unit"?: MeasurementUnitTime;
  "type"?: MeasurementUnitUnitType;
};

/** Unit of area used to measure a quantity. */
export type MeasurementUnitArea = "IMPERIAL_ACRE" | "IMPERIAL_SQUARE_INCH" | "IMPERIAL_SQUARE_FOOT" | "IMPERIAL_SQUARE_YARD" | "IMPERIAL_SQUARE_MILE" | "METRIC_SQUARE_CENTIMETER" | "METRIC_SQUARE_METER" | "METRIC_SQUARE_KILOMETER";

/** The information needed to define a custom unit, provided by the seller. */
export type MeasurementUnitCustom = {
  "name": string;
  "abbreviation": string;
};

export type MeasurementUnitGeneric = "UNIT";

/** The unit of length used to measure a quantity. */
export type MeasurementUnitLength = "IMPERIAL_INCH" | "IMPERIAL_FOOT" | "IMPERIAL_YARD" | "IMPERIAL_MILE" | "METRIC_MILLIMETER" | "METRIC_CENTIMETER" | "METRIC_METER" | "METRIC_KILOMETER";

/** Unit of time used to measure a quantity (a duration). */
export type MeasurementUnitTime = "GENERIC_MILLISECOND" | "GENERIC_SECOND" | "GENERIC_MINUTE" | "GENERIC_HOUR" | "GENERIC_DAY";

/** Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. */
export type MeasurementUnitUnitType = "TYPE_CUSTOM" | "TYPE_AREA" | "TYPE_LENGTH" | "TYPE_VOLUME" | "TYPE_WEIGHT" | "TYPE_GENERIC";

/** The unit of volume used to measure a quantity. */
export type MeasurementUnitVolume = "GENERIC_FLUID_OUNCE" | "GENERIC_SHOT" | "GENERIC_CUP" | "GENERIC_PINT" | "GENERIC_QUART" | "GENERIC_GALLON" | "IMPERIAL_CUBIC_INCH" | "IMPERIAL_CUBIC_FOOT" | "IMPERIAL_CUBIC_YARD" | "METRIC_MILLILITER" | "METRIC_LITER";

/** Unit of weight used to measure a quantity. */
export type MeasurementUnitWeight = "IMPERIAL_WEIGHT_OUNCE" | "IMPERIAL_POUND" | "IMPERIAL_STONE" | "METRIC_MILLIGRAM" | "METRIC_GRAM" | "METRIC_KILOGRAM";

/** Represents a business that sells with Square. */
export type Merchant = {
  "id"?: string;
  "business_name"?: string;
  "country": Country;
  "language_code"?: string;
  "currency"?: Currency;
  "status"?: MerchantStatus;
  "main_location_id"?: string;
  "created_at"?: string;
};

/** Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)
is created by the subscribing application. Subscribe to this event to be notified
when your application creates a merchant custom attribute definition. */
export type MerchantCustomAttributeDefinitionOwnedCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)
is deleted by the subscribing application. Subscribe to this event to be notified
when your application deletes a merchant custom attribute definition. */
export type MerchantCustomAttributeDefinitionOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)
is updated by the subscribing application. Subscribe to this event to be notified
when your application updates a merchant custom attribute definition. */
export type MerchantCustomAttributeDefinitionOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to the subscribing application is created. A notification is sent when your application
creates a custom attribute definition or another application creates a custom attribute definition whose
`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type MerchantCustomAttributeDefinitionVisibleCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to the subscribing application is deleted. A notification is sent when your application
deletes a custom attribute definition or another application deletes a custom attribute definition whose
`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type MerchantCustomAttributeDefinitionVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)
that is visible to the subscribing application is updated. A notification is sent when your application
updates a custom attribute definition or another application updates a custom attribute definition whose
`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. */
export type MerchantCustomAttributeDefinitionVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when a merchant [custom attribute](entity:CustomAttribute)
associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is
owned by the subscribing application is deleted. Subscribe to this event to be notified
when your application deletes a merchant custom attribute. */
export type MerchantCustomAttributeOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a merchant [custom attribute](entity:CustomAttribute)
associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is
owned by the subscribing application is updated. Subscribe to this event to be notified
when your application updates a merchant custom attribute. */
export type MerchantCustomAttributeOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a merchant [custom attribute](entity:CustomAttribute) with
the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.
An application that subscribes to this event is notified when a merchant custom attribute is deleted
by any application for which the subscribing application has read access to the merchant custom attribute. */
export type MerchantCustomAttributeVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when a merchant [custom attribute](entity:CustomAttribute) with
the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.
An application that subscribes to this event is notified when a merchant custom attribute is updated
by any application for which the subscribing application has read access to the merchant custom attribute. */
export type MerchantCustomAttributeVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when online checkout merchant settings are updated */
export type MerchantSettingsUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: MerchantSettingsUpdatedEventData;
};

export type MerchantSettingsUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: MerchantSettingsUpdatedEventObject;
};

export type MerchantSettingsUpdatedEventObject = {
  "merchant_settings"?: CheckoutMerchantSettings;
};

export type MerchantStatus = "ACTIVE" | "INACTIVE";

/** Location-specific overrides for specified properties of a `CatalogModifier` object. */
export type ModifierLocationOverrides = {
  "location_id"?: string;
  "price_money"?: Money;
  "sold_out"?: boolean;
};

/** 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. */
export type Money = {
  "amount"?: number;
  "currency"?: Currency;
};

/** Published when a merchant/application revokes all access tokens and refresh tokens granted to an application. */
export type OauthAuthorizationRevokedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: OauthAuthorizationRevokedEventData;
};

export type OauthAuthorizationRevokedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: OauthAuthorizationRevokedEventObject;
};

export type OauthAuthorizationRevokedEventObject = {
  "revocation"?: OauthAuthorizationRevokedEventRevocationObject;
};

export type OauthAuthorizationRevokedEventRevocationObject = {
  "revoked_at"?: string;
  "revoker_type"?: OauthAuthorizationRevokedEventRevokerType;
};

/** Defines the possible types for the revoking client. */
export type OauthAuthorizationRevokedEventRevokerType = "APPLICATION" | "MERCHANT" | "SQUARE";

/** Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) request. */
export type ObtainTokenRequest = {
  "client_id": string;
  "client_secret"?: string;
  "code"?: string;
  "redirect_uri"?: string;
  "grant_type": string;
  "refresh_token"?: string;
  "migration_token"?: string;
  "scopes"?: Array<string>;
  "short_lived"?: boolean;
  "code_verifier"?: string;
  "use_jwt"?: boolean;
};

/** Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) response. */
export type ObtainTokenResponse = {
  "access_token"?: string;
  "token_type"?: string;
  "expires_at"?: string;
  "merchant_id"?: string;
  "subscription_id"?: string;
  "plan_id"?: string;
  "id_token"?: string;
  "refresh_token"?: string;
  "short_lived"?: boolean;
  "errors"?: Array<Error>;
  "refresh_token_expires_at"?: string;
};

/** Details specific to offline payments. */
export type OfflinePaymentDetails = {
  "client_created_at"?: string;
};

/** 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. */
export type Order = {
  "id"?: string;
  "location_id": string;
  "reference_id"?: string;
  "source"?: OrderSource;
  "customer_id"?: string;
  "line_items"?: Array<OrderLineItem>;
  "taxes"?: Array<OrderLineItemTax>;
  "discounts"?: Array<OrderLineItemDiscount>;
  "service_charges"?: Array<OrderServiceCharge>;
  "fulfillments"?: Array<Fulfillment>;
  "returns"?: Array<OrderReturn>;
  "return_amounts"?: OrderMoneyAmounts;
  "net_amounts"?: OrderMoneyAmounts;
  "rounding_adjustment"?: OrderRoundingAdjustment;
  "tenders"?: Array<Tender>;
  "refunds"?: Array<Refund>;
  "metadata"?: Record<string, string>;
  "created_at"?: string;
  "updated_at"?: string;
  "closed_at"?: string;
  "state"?: OrderState;
  "version"?: number;
  "total_money"?: Money;
  "total_tax_money"?: Money;
  "total_discount_money"?: Money;
  "total_tip_money"?: Money;
  "total_service_charge_money"?: Money;
  "ticket_name"?: string;
  "pricing_options"?: OrderPricingOptions;
  "rewards"?: Array<OrderReward>;
  "net_amount_due_money"?: Money;
};

/** Indicates whether the card surcharge will be treated as a value-holding line item or
apportioned across all line items. */
export type OrderCardSurchargeTreatmentType = "LINE_ITEM_TREATMENT" | "APPORTIONED_TREATMENT";

export type OrderCreated = {
  "order_id"?: string;
  "version"?: number;
  "location_id"?: string;
  "state"?: OrderState;
  "created_at"?: string;
};

/** Published when an [Order](entity:Order) is created. This event is
triggered only by the [CreateOrder](api-endpoint:Orders-CreateOrder) endpoint call.

Creating an order in the Point of Sale app will **not** publish this event. */
export type OrderCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: OrderCreatedEventData;
};

export type OrderCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: OrderCreatedObject;
};

export type OrderCreatedObject = {
  "order_created"?: OrderCreated;
};

/** Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is created. */
export type OrderCustomAttributeDefinitionOwnedCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted. */
export type OrderCustomAttributeDefinitionOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated. */
export type OrderCustomAttributeDefinitionOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is created. */
export type OrderCustomAttributeDefinitionVisibleCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is deleted. */
export type OrderCustomAttributeDefinitionVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is updated. */
export type OrderCustomAttributeDefinitionVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeDefinitionEventData;
};

/** Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted. */
export type OrderCustomAttributeOwnedDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated. */
export type OrderCustomAttributeOwnedUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is deleted. */
export type OrderCustomAttributeVisibleDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is updated. */
export type OrderCustomAttributeVisibleUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: CustomAttributeEventData;
};

/** A lightweight description of an [order](entity:Order) that is returned when
`returned_entries` is `true` on a [SearchOrdersRequest](api-endpoint:Orders-SearchOrders). */
export type OrderEntry = {
  "order_id"?: string;
  "version"?: number;
  "location_id"?: string;
};

/** The schedule type of the delivery fulfillment. */
export type OrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED" | "ASAP";

/** 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. */
export type OrderFulfillmentFulfillmentLineItemApplication = "ALL" | "ENTRY_LIST";

/** The schedule type of the pickup fulfillment. */
export type OrderFulfillmentPickupDetailsScheduleType = "SCHEDULED" | "ASAP";

/** The current state of this fulfillment. */
export type OrderFulfillmentState = "PROPOSED" | "RESERVED" | "PREPARED" | "COMPLETED" | "CANCELED" | "FAILED";

/** The type of fulfillment. */
export type OrderFulfillmentType = "PICKUP" | "SHIPMENT" | "DELIVERY";

export type OrderFulfillmentUpdated = {
  "order_id"?: string;
  "version"?: number;
  "location_id"?: string;
  "state"?: OrderState;
  "created_at"?: string;
  "updated_at"?: string;
  "fulfillment_update"?: Array<OrderFulfillmentUpdatedUpdate>;
};

/** Published when an [OrderFulfillment](entity:OrderFulfillment)
is created or updated. This event is triggered only by the
[UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint call. */
export type OrderFulfillmentUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: OrderFulfillmentUpdatedEventData;
};

export type OrderFulfillmentUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: OrderFulfillmentUpdatedObject;
};

export type OrderFulfillmentUpdatedObject = {
  "order_fulfillment_updated"?: OrderFulfillmentUpdated;
};

/** Information about fulfillment updates. */
export type OrderFulfillmentUpdatedUpdate = {
  "fulfillment_uid"?: string;
  "old_state"?: FulfillmentState;
  "new_state"?: FulfillmentState;
};

/** Represents a line item in an order. Each line item describes a different
product to purchase, with its own quantity and price details. */
export type OrderLineItem = {
  "uid"?: string;
  "name"?: string;
  "quantity": string;
  "quantity_unit"?: OrderQuantityUnit;
  "note"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "variation_name"?: string;
  "item_type"?: OrderLineItemItemType;
  "metadata"?: Record<string, string>;
  "modifiers"?: Array<OrderLineItemModifier>;
  "applied_taxes"?: Array<OrderLineItemAppliedTax>;
  "applied_discounts"?: Array<OrderLineItemAppliedDiscount>;
  "applied_service_charges"?: Array<OrderLineItemAppliedServiceCharge>;
  "base_price_money"?: Money;
  "variation_total_price_money"?: Money;
  "gross_sales_money"?: Money;
  "total_tax_money"?: Money;
  "total_discount_money"?: Money;
  "total_money"?: Money;
  "pricing_blocklists"?: OrderLineItemPricingBlocklists;
  "total_service_charge_money"?: Money;
};

/** 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. */
export type OrderLineItemAppliedDiscount = {
  "uid"?: string;
  "discount_uid": string;
  "applied_money"?: Money;
};

export type OrderLineItemAppliedServiceCharge = {
  "uid"?: string;
  "service_charge_uid": string;
  "applied_money"?: Money;
};

/** 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. */
export type OrderLineItemAppliedTax = {
  "uid"?: string;
  "tax_uid": string;
  "applied_money"?: Money;
  "auto_applied"?: boolean;
};

/** 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. */
export type OrderLineItemDiscount = {
  "uid"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "name"?: string;
  "type"?: OrderLineItemDiscountType;
  "percentage"?: string;
  "amount_money"?: Money;
  "applied_money"?: Money;
  "metadata"?: Record<string, string>;
  "scope"?: OrderLineItemDiscountScope;
  "reward_ids"?: Array<string>;
  "pricing_rule_id"?: string;
};

/** Indicates whether this is a line-item or order-level discount. */
export type OrderLineItemDiscountScope = "OTHER_DISCOUNT_SCOPE" | "LINE_ITEM" | "ORDER";

/** Indicates how the discount is applied to the associated line item or order. */
export type OrderLineItemDiscountType = "UNKNOWN_DISCOUNT" | "FIXED_PERCENTAGE" | "FIXED_AMOUNT" | "VARIABLE_PERCENTAGE" | "VARIABLE_AMOUNT";

/** Represents the line item type. */
export type OrderLineItemItemType = "ITEM" | "CUSTOM_AMOUNT" | "GIFT_CARD";

/** A [CatalogModifier](entity:CatalogModifier). */
export type OrderLineItemModifier = {
  "uid"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "name"?: string;
  "quantity"?: string;
  "base_price_money"?: Money;
  "total_price_money"?: Money;
  "metadata"?: Record<string, string>;
};

/** 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). */
export type OrderLineItemPricingBlocklists = {
  "blocked_discounts"?: Array<OrderLineItemPricingBlocklistsBlockedDiscount>;
  "blocked_taxes"?: Array<OrderLineItemPricingBlocklistsBlockedTax>;
  "blocked_service_charges"?: Array<OrderLineItemPricingBlocklistsBlockedServiceCharge>;
};

/** 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. */
export type OrderLineItemPricingBlocklistsBlockedDiscount = {
  "uid"?: string;
  "discount_uid"?: string;
  "discount_catalog_object_id"?: string;
};

/** A service charge to block from applying to a line item. The service charge
must be identified by either `service_charge_uid` or
`service_charge_catalog_object_id`, but not both. */
export type OrderLineItemPricingBlocklistsBlockedServiceCharge = {
  "uid"?: string;
  "service_charge_uid"?: string;
  "service_charge_catalog_object_id"?: string;
};

/** 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. */
export type OrderLineItemPricingBlocklistsBlockedTax = {
  "uid"?: string;
  "tax_uid"?: string;
  "tax_catalog_object_id"?: string;
};

/** 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. */
export type OrderLineItemTax = {
  "uid"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "name"?: string;
  "type"?: OrderLineItemTaxType;
  "percentage"?: string;
  "metadata"?: Record<string, string>;
  "applied_money"?: Money;
  "scope"?: OrderLineItemTaxScope;
  "auto_applied"?: boolean;
};

/** Indicates whether this is a line-item or order-level tax. */
export type OrderLineItemTaxScope = "OTHER_TAX_SCOPE" | "LINE_ITEM" | "ORDER";

/** Indicates how the tax is applied to the associated line item or order. */
export type OrderLineItemTaxType = "UNKNOWN_TAX" | "ADDITIVE" | "INCLUSIVE";

/** A collection of various money amounts. */
export type OrderMoneyAmounts = {
  "total_money"?: Money;
  "tax_money"?: Money;
  "discount_money"?: Money;
  "tip_money"?: Money;
  "service_charge_money"?: Money;
};

/** 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](entity:CatalogPricingRule). */
export type OrderPricingOptions = {
  "auto_apply_discounts"?: boolean;
  "auto_apply_taxes"?: boolean;
};

/** Contains the measurement unit for a quantity and a precision that
specifies the number of digits after the decimal point for decimal quantities. */
export type OrderQuantityUnit = {
  "measurement_unit"?: MeasurementUnit;
  "precision"?: number;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
};

/** The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order. */
export type OrderReturn = {
  "uid"?: string;
  "source_order_id"?: string;
  "return_line_items"?: Array<OrderReturnLineItem>;
  "return_service_charges"?: Array<OrderReturnServiceCharge>;
  "return_taxes"?: Array<OrderReturnTax>;
  "return_discounts"?: Array<OrderReturnDiscount>;
  "return_tips"?: Array<OrderReturnTip>;
  "rounding_adjustment"?: OrderRoundingAdjustment;
  "return_amounts"?: OrderMoneyAmounts;
};

/** 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. */
export type OrderReturnDiscount = {
  "uid"?: string;
  "source_discount_uid"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "name"?: string;
  "type"?: OrderLineItemDiscountType;
  "percentage"?: string;
  "amount_money"?: Money;
  "applied_money"?: Money;
  "scope"?: OrderLineItemDiscountScope;
};

/** The line item being returned in an order. */
export type OrderReturnLineItem = {
  "uid"?: string;
  "source_line_item_uid"?: string;
  "name"?: string;
  "quantity": string;
  "quantity_unit"?: OrderQuantityUnit;
  "note"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "variation_name"?: string;
  "item_type"?: OrderLineItemItemType;
  "return_modifiers"?: Array<OrderReturnLineItemModifier>;
  "applied_taxes"?: Array<OrderLineItemAppliedTax>;
  "applied_discounts"?: Array<OrderLineItemAppliedDiscount>;
  "base_price_money"?: Money;
  "variation_total_price_money"?: Money;
  "gross_return_money"?: Money;
  "total_tax_money"?: Money;
  "total_discount_money"?: Money;
  "total_money"?: Money;
  "applied_service_charges"?: Array<OrderLineItemAppliedServiceCharge>;
  "total_service_charge_money"?: Money;
};

/** A line item modifier being returned. */
export type OrderReturnLineItemModifier = {
  "uid"?: string;
  "source_modifier_uid"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "name"?: string;
  "base_price_money"?: Money;
  "total_price_money"?: Money;
  "quantity"?: string;
};

/** Represents the service charge applied to the original order. */
export type OrderReturnServiceCharge = {
  "uid"?: string;
  "source_service_charge_uid"?: string;
  "name"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "percentage"?: string;
  "amount_money"?: Money;
  "applied_money"?: Money;
  "total_money"?: Money;
  "total_tax_money"?: Money;
  "calculation_phase"?: OrderServiceChargeCalculationPhase;
  "taxable"?: boolean;
  "applied_taxes"?: Array<OrderLineItemAppliedTax>;
  "treatment_type"?: OrderServiceChargeTreatmentType;
  "scope"?: OrderServiceChargeScope;
  "type"?: OrderServiceChargeType;
};

/** 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. */
export type OrderReturnTax = {
  "uid"?: string;
  "source_tax_uid"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "name"?: string;
  "type"?: OrderLineItemTaxType;
  "percentage"?: string;
  "applied_money"?: Money;
  "scope"?: OrderLineItemTaxScope;
};

/** A tip being returned. */
export type OrderReturnTip = {
  "uid"?: string;
  "applied_money"?: Money;
  "source_tender_uid"?: string;
  "source_tender_id"?: string;
};

/** 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. */
export type OrderReward = {
  "id": string;
  "reward_tier_id": string;
};

/** 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. */
export type OrderRoundingAdjustment = {
  "uid"?: string;
  "name"?: string;
  "amount_money"?: Money;
};

/** Represents a service charge applied to an order. */
export type OrderServiceCharge = {
  "uid"?: string;
  "name"?: string;
  "catalog_object_id"?: string;
  "catalog_version"?: number;
  "percentage"?: string;
  "amount_money"?: Money;
  "applied_money"?: Money;
  "total_money"?: Money;
  "total_tax_money"?: Money;
  "calculation_phase"?: OrderServiceChargeCalculationPhase;
  "taxable"?: boolean;
  "applied_taxes"?: Array<OrderLineItemAppliedTax>;
  "metadata"?: Record<string, string>;
  "type"?: OrderServiceChargeType;
  "treatment_type"?: OrderServiceChargeTreatmentType;
  "scope"?: OrderServiceChargeScope;
};

/** 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) */
export type OrderServiceChargeCalculationPhase = "SUBTOTAL_PHASE" | "TOTAL_PHASE" | "APPORTIONED_PERCENTAGE_PHASE" | "APPORTIONED_AMOUNT_PHASE";

/** Indicates whether this is a line-item or order-level apportioned
service charge. */
export type OrderServiceChargeScope = "OTHER_SERVICE_CHARGE_SCOPE" | "LINE_ITEM" | "ORDER";

/** Indicates whether the service charge will be treated as a value-holding line item or
apportioned toward a line item. */
export type OrderServiceChargeTreatmentType = "LINE_ITEM_TREATMENT" | "APPORTIONED_TREATMENT";

export type OrderServiceChargeType = "AUTO_GRATUITY" | "CUSTOM";

/** Represents the origination details of an order. */
export type OrderSource = {
  "name"?: string;
};

/** The state of the order. */
export type OrderState = "OPEN" | "COMPLETED" | "CANCELED" | "DRAFT";

export type OrderUpdated = {
  "order_id"?: string;
  "version"?: number;
  "location_id"?: string;
  "state"?: OrderState;
  "created_at"?: string;
  "updated_at"?: string;
};

/** Published when an [Order](entity:Order) is updated. This
event is triggered by the [UpdateOrder](api-endpoint:Orders-UpdateOrder)
endpoint call, Order Manager, or the Square Dashboard. */
export type OrderUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: OrderUpdatedEventData;
};

export type OrderUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: OrderUpdatedObject;
};

export type OrderUpdatedObject = {
  "order_updated"?: OrderUpdated;
};

/** Defines input parameters in a request to the
[PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) endpoint. */
export type PauseSubscriptionRequest = {
  "pause_effective_date"?: string;
  "pause_cycle_duration"?: number;
  "resume_effective_date"?: string;
  "resume_change_timing"?: ChangeTiming;
  "pause_reason"?: string;
};

/** Defines output parameters in a response from the
[PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) endpoint. */
export type PauseSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
  "actions"?: Array<SubscriptionAction>;
};

/** Defines the fields that are included in requests to the
[PayOrder](api-endpoint:Orders-PayOrder) endpoint. */
export type PayOrderRequest = {
  "idempotency_key": string;
  "order_version"?: number;
  "payment_ids"?: Array<string>;
};

/** Defines the fields that are included in the response body of a request to the
[PayOrder](api-endpoint:Orders-PayOrder) endpoint. */
export type PayOrderResponse = {
  "errors"?: Array<Error>;
  "order"?: Order;
};

/** Represents a payment processed by the Square API. */
export type Payment = {
  "id"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "amount_money"?: Money;
  "tip_money"?: Money;
  "total_money"?: Money;
  "app_fee_money"?: Money;
  "app_fee_allocations"?: Array<AppFeeAllocation>;
  "approved_money"?: Money;
  "processing_fee"?: Array<ProcessingFee>;
  "refunded_money"?: Money;
  "status"?: string;
  "delay_duration"?: string;
  "delay_action"?: string;
  "delayed_until"?: string;
  "source_type"?: string;
  "card_details"?: CardPaymentDetails;
  "cash_details"?: CashPaymentDetails;
  "bank_account_details"?: BankAccountPaymentDetails;
  "electronic_money_details"?: ElectronicMoneyDetails;
  "external_details"?: ExternalPaymentDetails;
  "wallet_details"?: DigitalWalletDetails;
  "buy_now_pay_later_details"?: BuyNowPayLaterDetails;
  "square_account_details"?: SquareAccountDetails;
  "location_id"?: string;
  "order_id"?: string;
  "reference_id"?: string;
  "customer_id"?: string;
  "employee_id"?: string;
  "team_member_id"?: string;
  "refund_ids"?: Array<string>;
  "risk_evaluation"?: RiskEvaluation;
  "terminal_checkout_id"?: string;
  "buyer_email_address"?: string;
  "billing_address"?: Address;
  "shipping_address"?: Address;
  "note"?: string;
  "statement_description_identifier"?: string;
  "capabilities"?: Array<string>;
  "receipt_number"?: string;
  "receipt_url"?: string;
  "device_details"?: DeviceDetails;
  "application_details"?: ApplicationDetails;
  "buyer_currency_exchange"?: CurrencyExchange;
  "is_offline_payment"?: boolean;
  "offline_payment_details"?: OfflinePaymentDetails;
  "version_token"?: string;
};

export type PaymentBalanceActivityAppFeeRefundDetail = {
  "payment_id"?: string;
  "refund_id"?: string;
  "location_id"?: string;
};

export type PaymentBalanceActivityAppFeeRevenueDetail = {
  "payment_id"?: string;
  "location_id"?: string;
};

export type PaymentBalanceActivityAutomaticSavingsDetail = {
  "payment_id"?: string;
  "payout_id"?: string;
};

export type PaymentBalanceActivityAutomaticSavingsReversedDetail = {
  "payment_id"?: string;
  "payout_id"?: string;
};

export type PaymentBalanceActivityChargeDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityDepositFeeDetail = {
  "payout_id"?: string;
};

export type PaymentBalanceActivityDepositFeeReversedDetail = {
  "payout_id"?: string;
};

export type PaymentBalanceActivityDisputeDetail = {
  "payment_id"?: string;
  "dispute_id"?: string;
};

export type PaymentBalanceActivityFeeDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityFreeProcessingDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityHoldAdjustmentDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityOpenDisputeDetail = {
  "payment_id"?: string;
  "dispute_id"?: string;
};

export type PaymentBalanceActivityOtherAdjustmentDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityOtherDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityRefundDetail = {
  "payment_id"?: string;
  "refund_id"?: string;
};

export type PaymentBalanceActivityReleaseAdjustmentDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityReserveHoldDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityReserveReleaseDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivitySquareCapitalPaymentDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivitySquareCapitalReversedPaymentDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivitySquarePayrollTransferDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivitySquarePayrollTransferReversedDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityTaxOnFeeDetail = {
  "payment_id"?: string;
  "tax_rate_description"?: string;
};

export type PaymentBalanceActivityThirdPartyFeeDetail = {
  "payment_id"?: string;
};

export type PaymentBalanceActivityThirdPartyFeeRefundDetail = {
  "payment_id"?: string;
  "refund_id"?: string;
};

/** Published when a [Payment](entity:Payment) is created. */
export type PaymentCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: PaymentCreatedEventData;
};

export type PaymentCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: PaymentCreatedEventObject;
};

export type PaymentCreatedEventObject = {
  "payment"?: Payment;
};

export type PaymentLink = {
  "id"?: string;
  "version": number;
  "description"?: string;
  "order_id"?: string;
  "checkout_options"?: CheckoutOptions;
  "pre_populated_data"?: PrePopulatedData;
  "url"?: string;
  "long_url"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "payment_note"?: string;
};

export type PaymentLinkRelatedResources = {
  "orders"?: Array<Order>;
  "subscription_plans"?: Array<CatalogObject>;
};

export type PaymentOptions = {
  "autocomplete"?: boolean;
  "delay_duration"?: string;
  "accept_partial_authorization"?: boolean;
  "delay_action"?: PaymentOptionsDelayAction;
};

/** Describes the action to be applied to a delayed capture payment when the delay_duration
has elapsed. */
export type PaymentOptionsDelayAction = "CANCEL" | "COMPLETE";

/** Represents a refund of a payment made using Square. Contains information about
the original payment and the amount of money refunded. */
export type PaymentRefund = {
  "id": string;
  "status"?: string;
  "location_id"?: string;
  "unlinked"?: boolean;
  "destination_type"?: string;
  "destination_details"?: DestinationDetails;
  "amount_money": Money;
  "app_fee_money"?: Money;
  "app_fee_allocations"?: Array<AppFeeAllocation>;
  "processing_fee"?: Array<ProcessingFee>;
  "payment_id"?: string;
  "order_id"?: string;
  "reason"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "team_member_id"?: string;
  "terminal_refund_id"?: string;
};

/** Published when a [Payment](entity:Payment) is updated.
Typically the `payment.status`, or `card_details.status` fields are updated
as a payment is canceled, authorized, or completed. */
export type PaymentUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: PaymentUpdatedEventData;
};

export type PaymentUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: PaymentUpdatedEventObject;
};

export type PaymentUpdatedEventObject = {
  "payment"?: Payment;
};

/** An accounting of the amount owed the seller and record of the actual transfer to their
external bank account or to the Square balance. */
export type Payout = {
  "id": string;
  "status"?: PayoutStatus;
  "location_id": string;
  "created_at"?: string;
  "updated_at"?: string;
  "amount_money"?: Money;
  "destination"?: Destination;
  "version"?: number;
  "type"?: PayoutType;
  "payout_fee"?: Array<PayoutFee>;
  "arrival_date"?: string;
  "end_to_end_id"?: string;
};

/** One or more PayoutEntries that make up a Payout. Each one has a date, amount, and type of activity.
The total amount of the payout will equal the sum of the payout entries for a batch payout */
export type PayoutEntry = {
  "id": string;
  "payout_id": string;
  "effective_at"?: string;
  "type"?: ActivityType;
  "gross_amount_money"?: Money;
  "fee_amount_money"?: Money;
  "net_amount_money"?: Money;
  "type_app_fee_revenue_details"?: PaymentBalanceActivityAppFeeRevenueDetail;
  "type_app_fee_refund_details"?: PaymentBalanceActivityAppFeeRefundDetail;
  "type_automatic_savings_details"?: PaymentBalanceActivityAutomaticSavingsDetail;
  "type_automatic_savings_reversed_details"?: PaymentBalanceActivityAutomaticSavingsReversedDetail;
  "type_charge_details"?: PaymentBalanceActivityChargeDetail;
  "type_deposit_fee_details"?: PaymentBalanceActivityDepositFeeDetail;
  "type_deposit_fee_reversed_details"?: PaymentBalanceActivityDepositFeeReversedDetail;
  "type_dispute_details"?: PaymentBalanceActivityDisputeDetail;
  "type_fee_details"?: PaymentBalanceActivityFeeDetail;
  "type_free_processing_details"?: PaymentBalanceActivityFreeProcessingDetail;
  "type_hold_adjustment_details"?: PaymentBalanceActivityHoldAdjustmentDetail;
  "type_open_dispute_details"?: PaymentBalanceActivityOpenDisputeDetail;
  "type_other_details"?: PaymentBalanceActivityOtherDetail;
  "type_other_adjustment_details"?: PaymentBalanceActivityOtherAdjustmentDetail;
  "type_refund_details"?: PaymentBalanceActivityRefundDetail;
  "type_release_adjustment_details"?: PaymentBalanceActivityReleaseAdjustmentDetail;
  "type_reserve_hold_details"?: PaymentBalanceActivityReserveHoldDetail;
  "type_reserve_release_details"?: PaymentBalanceActivityReserveReleaseDetail;
  "type_square_capital_payment_details"?: PaymentBalanceActivitySquareCapitalPaymentDetail;
  "type_square_capital_reversed_payment_details"?: PaymentBalanceActivitySquareCapitalReversedPaymentDetail;
  "type_tax_on_fee_details"?: PaymentBalanceActivityTaxOnFeeDetail;
  "type_third_party_fee_details"?: PaymentBalanceActivityThirdPartyFeeDetail;
  "type_third_party_fee_refund_details"?: PaymentBalanceActivityThirdPartyFeeRefundDetail;
  "type_square_payroll_transfer_details"?: PaymentBalanceActivitySquarePayrollTransferDetail;
  "type_square_payroll_transfer_reversed_details"?: PaymentBalanceActivitySquarePayrollTransferReversedDetail;
};

/** Published when a [Payout](entity:Payout) has failed. */
export type PayoutFailedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: PayoutFailedEventData;
};

export type PayoutFailedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: PayoutFailedEventObject;
};

export type PayoutFailedEventObject = {
  "payout"?: Payout;
};

/** Represents a payout fee that can incur as part of a payout. */
export type PayoutFee = {
  "amount_money"?: Money;
  "effective_at"?: string;
  "type"?: PayoutFeeType;
};

/** Represents the type of payout fee that can incur as part of a payout. */
export type PayoutFeeType = "TRANSFER_FEE" | "TAX_ON_TRANSFER_FEE";

/** Published when a [Payout](entity:Payout) is complete. */
export type PayoutPaidEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: PayoutPaidEventData;
};

export type PayoutPaidEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: PayoutPaidEventObject;
};

export type PayoutPaidEventObject = {
  "payout"?: Payout;
};

/** Published when a [Payout](entity:Payout) is sent. */
export type PayoutSentEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: PayoutSentEventData;
};

export type PayoutSentEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: PayoutSentEventObject;
};

export type PayoutSentEventObject = {
  "payout"?: Payout;
};

/** Payout status types */
export type PayoutStatus = "SENT" | "FAILED" | "PAID";

/** The type of payout: “BATCH” or “SIMPLE”.
BATCH payouts include a list of payout entries that can be considered settled.
SIMPLE payouts do not have any payout entries associated with them
and will show up as one of the payout entries in a future BATCH payout. */
export type PayoutType = "BATCH" | "SIMPLE";

/** Represents a phase, which can override subscription phases as defined by plan_id */
export type Phase = {
  "uid"?: string;
  "ordinal"?: number;
  "order_template_id"?: string;
  "plan_phase_uid"?: string;
};

/** Represents the arguments used to construct a new phase. */
export type PhaseInput = {
  "ordinal": number;
  "order_template_id"?: string;
};

/** Describes buyer data to prepopulate in the payment form.
For more information,
see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). */
export type PrePopulatedData = {
  "buyer_email"?: string;
  "buyer_phone_number"?: string;
  "buyer_address"?: Address;
};

/** Represents the Square processing fee. */
export type ProcessingFee = {
  "effective_at"?: string;
  "type"?: string;
  "amount_money"?: Money;
};

/** Indicates the Square product used to generate a change. */
export type Product = "SQUARE_POS" | "EXTERNAL_API" | "BILLING" | "APPOINTMENTS" | "INVOICES" | "ONLINE_STORE" | "PAYROLL" | "DASHBOARD" | "ITEM_LIBRARY_IMPORT" | "OTHER";

export type ProductType = "TERMINAL_API";

/** Describes a `PublishInvoice` request. */
export type PublishInvoiceRequest = {
  "version": number;
  "idempotency_key"?: string;
};

/** Describes a `PublishInvoice` response. */
export type PublishInvoiceResponse = {
  "invoice"?: Invoice;
  "errors"?: Array<Error>;
};

/** Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) request. */
export type PublishScheduledShiftRequest = {
  "idempotency_key": string;
  "version"?: number;
  "scheduled_shift_notification_audience"?: ScheduledShiftNotificationAudience;
};

/** Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) response.
Either `scheduled_shift` or `errors` is present in the response. */
export type PublishScheduledShiftResponse = {
  "scheduled_shift"?: ScheduledShift;
  "errors"?: Array<Error>;
};

/** Fields to describe the action that displays QR-Codes. */
export type QrCodeOptions = {
  "title": string;
  "body": string;
  "barcode_contents": string;
};

/** Describes an ad hoc item and price to generate a quick pay checkout link.
For more information,
see [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). */
export type QuickPay = {
  "name": string;
  "price_money": Money;
  "location_id": string;
};

/** The range of a number value between the specified lower and upper bounds. */
export type Range = {
  "min"?: string;
  "max"?: string;
};

/** Describes receipt action fields. */
export type ReceiptOptions = {
  "payment_id": string;
  "print_only"?: boolean;
  "is_duplicate"?: boolean;
};

/** Request to record receipt of items for a transfer order */
export type ReceiveTransferOrderRequest = {
  "idempotency_key": string;
  "receipt": TransferOrderGoodsReceipt;
  "version"?: number;
};

/** Response for receiving items for a transfer order */
export type ReceiveTransferOrderResponse = {
  "transfer_order"?: TransferOrder;
  "errors"?: Array<Error>;
};

/** A request to redeem a loyalty reward. */
export type RedeemLoyaltyRewardRequest = {
  "idempotency_key": string;
  "location_id": string;
};

/** A response that includes the `LoyaltyEvent` published for redeeming the reward. */
export type RedeemLoyaltyRewardResponse = {
  "errors"?: Array<Error>;
  "event"?: LoyaltyEvent;
};

export type Reference = {
  "type"?: ReferenceType;
  "id"?: string;
};

/** The type of platform concept a channel can represent. */
export type ReferenceType = "UNKNOWN_TYPE" | "LOCATION" | "FIRST_PARTY_INTEGRATION" | "OAUTH_APPLICATION" | "ONLINE_SITE" | "ONLINE_CHECKOUT" | "INVOICE" | "GIFT_CARD" | "GIFT_CARD_MARKETPLACE" | "RECURRING_SUBSCRIPTION" | "ONLINE_BOOKING_FLOW" | "SQUARE_ASSISTANT" | "CASH_LOCAL" | "POINT_OF_SALE" | "KIOSK";

/** Represents a refund processed for a Square transaction. */
export type Refund = {
  "id": string;
  "location_id": string;
  "transaction_id"?: string;
  "tender_id"?: string;
  "created_at"?: string;
  "reason": string;
  "amount_money": Money;
  "status": RefundStatus;
  "processing_fee_money"?: Money;
  "additional_recipients"?: Array<AdditionalRecipient>;
};

/** Published when a [Refund](entity:PaymentRefund) is created. */
export type RefundCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: RefundCreatedEventData;
};

export type RefundCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: RefundCreatedEventObject;
};

export type RefundCreatedEventObject = {
  "refund"?: PaymentRefund;
};

/** Describes a request to refund a payment using [RefundPayment](api-endpoint:Refunds-RefundPayment). */
export type RefundPaymentRequest = {
  "idempotency_key": string;
  "amount_money": Money;
  "app_fee_money"?: Money;
  "app_fee_allocations"?: Array<AppFeeAllocation>;
  "payment_id"?: string;
  "destination_id"?: string;
  "unlinked"?: boolean;
  "location_id"?: string;
  "customer_id"?: string;
  "reason"?: string;
  "payment_version_token"?: string;
  "team_member_id"?: string;
  "cash_details"?: DestinationDetailsCashRefundDetails;
  "external_details"?: DestinationDetailsExternalRefundDetails;
};

/** Defines the response returned by
[RefundPayment](api-endpoint:Refunds-RefundPayment).

If there are errors processing the request, the `refund` field might not be
present, or it might be present with a status of `FAILED`. */
export type RefundPaymentResponse = {
  "errors"?: Array<Error>;
  "refund"?: PaymentRefund;
};

/** Indicates a refund's current status. */
export type RefundStatus = "PENDING" | "APPROVED" | "REJECTED" | "FAILED";

/** Published when a [Refund](entity:PaymentRefund) is updated.
Typically the `refund.status` changes when a refund is completed. */
export type RefundUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: RefundUpdatedEventData;
};

export type RefundUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: RefundUpdatedEventObject;
};

export type RefundUpdatedEventObject = {
  "refund"?: PaymentRefund;
};

/** Defines the parameters that can be included in the body of
a request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) endpoint. */
export type RegisterDomainRequest = {
  "domain_name": string;
};

/** Defines the fields that are included in the response body of
a request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) endpoint.

Either `errors` or `status` are present in a given response (never both). */
export type RegisterDomainResponse = {
  "errors"?: Array<Error>;
  "status"?: RegisterDomainResponseStatus;
};

/** The status of the domain registration. */
export type RegisterDomainResponseStatus = "PENDING" | "VERIFIED";

/** Defines the fields that are included in the response body of
a request to the [RemoveGroupFromCustomer](api-endpoint:Customers-RemoveGroupFromCustomer)
endpoint. */
export type RemoveGroupFromCustomerResponse = {
  "errors"?: Array<Error>;
};

/** Defines input parameters in a request to the
[ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) endpoint. */
export type ResumeSubscriptionRequest = {
  "resume_effective_date"?: string;
  "resume_change_timing"?: ChangeTiming;
};

/** Defines output parameters in a response from the 
[ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) endpoint. */
export type ResumeSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
  "actions"?: Array<SubscriptionAction>;
};

/** Represents a [RetrieveBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type RetrieveBookingCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Represents a [RetrieveBookingCustomAttribute](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttribute) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type RetrieveBookingCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

export type RetrieveBookingResponse = {
  "booking"?: Booking;
  "errors"?: Array<Error>;
};

export type RetrieveBusinessBookingProfileResponse = {
  "business_booking_profile"?: BusinessBookingProfile;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [RetrieveCard](api-endpoint:Cards-RetrieveCard) endpoint.

Note: if there are errors processing the request, the card field will not be
present. */
export type RetrieveCardResponse = {
  "errors"?: Array<Error>;
  "card"?: Card;
};

export type RetrieveCashDrawerShiftResponse = {
  "cash_drawer_shift"?: CashDrawerShift;
  "errors"?: Array<Error>;
};

export type RetrieveCatalogObjectResponse = {
  "errors"?: Array<Error>;
  "object"?: CatalogObject;
  "related_objects"?: Array<CatalogObject>;
};

export type RetrieveChannelResponse = {
  "errors"?: Array<Error>;
  "channel"?: Channel;
};

/** Represents a [RetrieveCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type RetrieveCustomerCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Represents a [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type RetrieveCustomerCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [RetrieveCustomerGroup](api-endpoint:CustomerGroups-RetrieveCustomerGroup) endpoint.

Either `errors` or `group` is present in a given response (never both). */
export type RetrieveCustomerGroupResponse = {
  "errors"?: Array<Error>;
  "group"?: CustomerGroup;
};

/** 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). */
export type RetrieveCustomerResponse = {
  "errors"?: Array<Error>;
  "customer"?: Customer;
};

/** Defines the fields that are included in the response body for requests to the `RetrieveCustomerSegment` endpoint.

Either `errors` or `segment` is present in a given response (never both). */
export type RetrieveCustomerSegmentResponse = {
  "errors"?: Array<Error>;
  "segment"?: CustomerSegment;
};

/** Defines the fields in a `RetrieveDisputeEvidence` response. */
export type RetrieveDisputeEvidenceResponse = {
  "errors"?: Array<Error>;
  "evidence"?: DisputeEvidence;
};

/** Defines fields in a `RetrieveDispute` response. */
export type RetrieveDisputeResponse = {
  "errors"?: Array<Error>;
  "dispute"?: Dispute;
};

export type RetrieveEmployeeResponse = {
  "employee"?: Employee;
  "errors"?: Array<Error>;
};

/** A request to retrieve gift cards by their GANs. */
export type RetrieveGiftCardFromGANRequest = {
  "gan": string;
};

/** A response that contains a `GiftCard`. This response might contain a set of `Error` objects
if the request resulted in errors. */
export type RetrieveGiftCardFromGANResponse = {
  "errors"?: Array<Error>;
  "gift_card"?: GiftCard;
};

/** A request to retrieve a gift card by using a payment token. */
export type RetrieveGiftCardFromNonceRequest = {
  "nonce": string;
};

/** A response that contains a `GiftCard` object. If the request resulted in errors, 
the response contains a set of `Error` objects. */
export type RetrieveGiftCardFromNonceResponse = {
  "errors"?: Array<Error>;
  "gift_card"?: GiftCard;
};

/** A response that contains a `GiftCard`. The response might contain a set of `Error` objects
if the request resulted in errors. */
export type RetrieveGiftCardResponse = {
  "errors"?: Array<Error>;
  "gift_card"?: GiftCard;
};

export type RetrieveInventoryAdjustmentResponse = {
  "errors"?: Array<Error>;
  "adjustment"?: InventoryAdjustment;
};

export type RetrieveInventoryChangesResponse = {
  "errors"?: Array<Error>;
  "changes"?: Array<InventoryChange>;
  "cursor"?: string;
};

export type RetrieveInventoryCountResponse = {
  "errors"?: Array<Error>;
  "counts"?: Array<InventoryCount>;
  "cursor"?: string;
};

export type RetrieveInventoryPhysicalCountResponse = {
  "errors"?: Array<Error>;
  "count"?: InventoryPhysicalCount;
};

export type RetrieveInventoryTransferResponse = {
  "errors"?: Array<Error>;
  "transfer"?: InventoryTransfer;
};

/** Represents a [RetrieveJob](api-endpoint:Team-RetrieveJob) response. Either `job` or `errors`
is present in the response. */
export type RetrieveJobResponse = {
  "job"?: Job;
  "errors"?: Array<Error>;
};

export type RetrieveLocationBookingProfileResponse = {
  "location_booking_profile"?: LocationBookingProfile;
  "errors"?: Array<Error>;
};

/** Represents a [RetrieveLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type RetrieveLocationCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Represents a [RetrieveLocationCustomAttribute](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttribute) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type RetrieveLocationCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Defines the fields that the [RetrieveLocation](api-endpoint:Locations-RetrieveLocation)
endpoint returns in a response. */
export type RetrieveLocationResponse = {
  "errors"?: Array<Error>;
  "location"?: Location;
};

export type RetrieveLocationSettingsResponse = {
  "errors"?: Array<Error>;
  "location_settings"?: CheckoutLocationSettings;
};

/** A response that includes the loyalty account. */
export type RetrieveLoyaltyAccountResponse = {
  "errors"?: Array<Error>;
  "loyalty_account"?: LoyaltyAccount;
};

/** A response that contains the loyalty program. */
export type RetrieveLoyaltyProgramResponse = {
  "errors"?: Array<Error>;
  "program"?: LoyaltyProgram;
};

/** Represents a [RetrieveLoyaltyPromotionPromotions](api-endpoint:Loyalty-RetrieveLoyaltyPromotion) response. */
export type RetrieveLoyaltyPromotionResponse = {
  "errors"?: Array<Error>;
  "loyalty_promotion"?: LoyaltyPromotion;
};

/** A response that includes the loyalty reward. */
export type RetrieveLoyaltyRewardResponse = {
  "errors"?: Array<Error>;
  "reward"?: LoyaltyReward;
};

/** Represents a [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type RetrieveMerchantCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Represents a [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type RetrieveMerchantCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** The response object returned by the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint. */
export type RetrieveMerchantResponse = {
  "errors"?: Array<Error>;
  "merchant"?: Merchant;
};

export type RetrieveMerchantSettingsResponse = {
  "errors"?: Array<Error>;
  "merchant_settings"?: CheckoutMerchantSettings;
};

/** Represents a response from getting an order custom attribute definition. */
export type RetrieveOrderCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Represents a response from getting an order custom attribute. */
export type RetrieveOrderCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

export type RetrieveOrderResponse = {
  "order"?: Order;
  "errors"?: Array<Error>;
};

export type RetrievePaymentLinkResponse = {
  "errors"?: Array<Error>;
  "payment_link"?: PaymentLink;
};

/** Represents a [RetrieveScheduledShift](api-endpoint:Labor-RetrieveScheduledShift) response.
Either `scheduled_shift` or `errors` is present in the response. */
export type RetrieveScheduledShiftResponse = {
  "scheduled_shift"?: ScheduledShift;
  "errors"?: Array<Error>;
};

/** Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`. */
export type RetrieveSnippetResponse = {
  "errors"?: Array<Error>;
  "snippet"?: Snippet;
};

/** Defines output parameters in a response from the
[RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) endpoint. */
export type RetrieveSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
};

export type RetrieveTeamMemberBookingProfileResponse = {
  "team_member_booking_profile"?: TeamMemberBookingProfile;
  "errors"?: Array<Error>;
};

/** Represents a response from a retrieve request containing a `TeamMember` object or error messages. */
export type RetrieveTeamMemberResponse = {
  "team_member"?: TeamMember;
  "errors"?: Array<Error>;
};

/** A response to a request to get a `Timecard`. The response contains
the requested `Timecard` object and might contain a set of `Error` objects if
the request resulted in errors. */
export type RetrieveTimecardResponse = {
  "timecard"?: Timecard;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the `RetrieveTokenStatus` endpoint. */
export type RetrieveTokenStatusResponse = {
  "scopes"?: Array<string>;
  "expires_at"?: string;
  "client_id"?: string;
  "merchant_id"?: string;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [RetrieveTransaction](api-endpoint:Transactions-RetrieveTransaction) endpoint.

One of `errors` or `transaction` is present in a given response (never both). */
export type RetrieveTransactionResponse = {
  "errors"?: Array<Error>;
  "transaction"?: Transaction;
};

/** Response containing the requested transfer order */
export type RetrieveTransferOrderResponse = {
  "transfer_order"?: TransferOrder;
  "errors"?: Array<Error>;
};

/** Represents an output from a call to [RetrieveVendor](api-endpoint:Vendors-RetrieveVendor). */
export type RetrieveVendorResponse = {
  "errors"?: Array<Error>;
  "vendor"?: Vendor;
};

/** Represents a response from a retrieve request containing the specified `WageSetting` object or error messages. */
export type RetrieveWageSettingResponse = {
  "wage_setting"?: WageSetting;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in the response body of
a request to the [RetrieveWebhookSubscription](api-endpoint:WebhookSubscriptions-RetrieveWebhookSubscription) endpoint.

Note: if there are errors processing the request, the [Subscription](entity:WebhookSubscription) will not be
present. */
export type RetrieveWebhookSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: WebhookSubscription;
};

export type RevokeTokenRequest = {
  "client_id"?: string;
  "access_token"?: string;
  "merchant_id"?: string;
  "revoke_only_access_token"?: boolean;
};

export type RevokeTokenResponse = {
  "success"?: boolean;
  "errors"?: Array<Error>;
};

/** Represents fraud risk information for the associated payment.

When you take a payment through Square's Payments API (using the `CreatePayment`
endpoint), Square evaluates it and assigns a risk level to the payment. Sellers
can use this information to determine the course of action (for example,
provide the goods/services or refund the payment). */
export type RiskEvaluation = {
  "created_at"?: string;
  "risk_level"?: RiskEvaluationRiskLevel;
};

export type RiskEvaluationRiskLevel = "PENDING" | "NORMAL" | "MODERATE" | "HIGH";

/** Describes save-card action fields. */
export type SaveCardOptions = {
  "customer_id": string;
  "card_id"?: string;
  "reference_id"?: string;
};

/** Represents a specific time slot in a work schedule. This object is used to manage the
lifecycle of a scheduled shift from the draft to published state. A scheduled shift contains
the latest draft shift details and current published shift details. */
export type ScheduledShift = {
  "id"?: string;
  "draft_shift_details"?: ScheduledShiftDetails;
  "published_shift_details"?: ScheduledShiftDetails;
  "version"?: number;
  "created_at"?: string;
  "updated_at"?: string;
};

/** Represents shift details for draft and published versions of a [scheduled shift](entity:ScheduledShift),
such as job ID, team member assignment, and start and end times. */
export type ScheduledShiftDetails = {
  "team_member_id"?: string;
  "location_id"?: string;
  "job_id"?: string;
  "start_at"?: string;
  "end_at"?: string;
  "notes"?: string;
  "is_deleted"?: boolean;
  "timezone"?: string;
};

/** Defines filter criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts)
request. Multiple filters in a query are combined as an `AND` operation. */
export type ScheduledShiftFilter = {
  "location_ids"?: Array<string>;
  "start"?: TimeRange;
  "end"?: TimeRange;
  "workday"?: ScheduledShiftWorkday;
  "team_member_ids"?: Array<string>;
  "assignment_status"?: ScheduledShiftFilterAssignmentStatus;
  "scheduled_shift_statuses"?: Array<ScheduledShiftFilterScheduledShiftStatus>;
};

/** Defines valid values for the `assignment_status` filter in a
[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.
Assignment status is based on the `draft_shift_details.team_member_id` and
`published_shift_details.team_member_id` fields of the scheduled shift. */
export type ScheduledShiftFilterAssignmentStatus = "ASSIGNED" | "UNASSIGNED";

/** Defines valid values for the `scheduled_shift_statuses` filter in a
[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. */
export type ScheduledShiftFilterScheduledShiftStatus = "DRAFT" | "PUBLISHED";

/** Indicates whether Square sends an email notification to team members
when a scheduled shift is published and which team members receive the notification. */
export type ScheduledShiftNotificationAudience = "ALL" | "AFFECTED" | "NONE";

/** Represents filter and sort criteria for the `query` field in a
[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. */
export type ScheduledShiftQuery = {
  "filter"?: ScheduledShiftFilter;
  "sort"?: ScheduledShiftSort;
};

/** Defines sort criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts)
request. */
export type ScheduledShiftSort = {
  "field"?: ScheduledShiftSortField;
  "order"?: SortOrder;
};

/** Defines valid values for the `field` sort setting in a
[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. */
export type ScheduledShiftSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT";

/** A `ScheduledShift` search query filter parameter that sets a range of days that
a `Shift` must start or end in before passing the filter condition. */
export type ScheduledShiftWorkday = {
  "date_range"?: DateRange;
  "match_scheduled_shifts_by"?: ScheduledShiftWorkdayMatcher;
  "default_timezone"?: string;
};

/** Defines the logic used to apply a workday filter. */
export type ScheduledShiftWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION";

/** A query filter to search for buyer-accessible availabilities by. */
export type SearchAvailabilityFilter = {
  "start_at_range": TimeRange;
  "location_id"?: string;
  "segment_filters"?: Array<SegmentFilter>;
  "booking_id"?: string;
};

/** The query used to search for buyer-accessible availabilities of bookings. */
export type SearchAvailabilityQuery = {
  "filter": SearchAvailabilityFilter;
};

export type SearchAvailabilityRequest = {
  "query": SearchAvailabilityQuery;
};

export type SearchAvailabilityResponse = {
  "availabilities"?: Array<Availability>;
  "errors"?: Array<Error>;
};

/** Defines the request body for the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. */
export type SearchCatalogItemsRequest = {
  "text_filter"?: string;
  "category_ids"?: Array<string>;
  "stock_levels"?: Array<SearchCatalogItemsRequestStockLevel>;
  "enabled_location_ids"?: Array<string>;
  "cursor"?: string;
  "limit"?: number;
  "sort_order"?: SortOrder;
  "product_types"?: Array<CatalogItemProductType>;
  "custom_attribute_filters"?: Array<CustomAttributeFilter>;
  "archived_state"?: ArchivedState;
};

/** Defines supported stock levels of the item inventory. */
export type SearchCatalogItemsRequestStockLevel = "OUT" | "LOW";

/** Defines the response body returned from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. */
export type SearchCatalogItemsResponse = {
  "errors"?: Array<Error>;
  "items"?: Array<CatalogObject>;
  "cursor"?: string;
  "matched_variation_ids"?: Array<string>;
};

export type SearchCatalogObjectsRequest = {
  "cursor"?: string;
  "object_types"?: Array<CatalogObjectType>;
  "include_deleted_objects"?: boolean;
  "include_related_objects"?: boolean;
  "begin_time"?: string;
  "query"?: CatalogQuery;
  "limit"?: number;
  "include_category_path_to_root"?: boolean;
};

export type SearchCatalogObjectsResponse = {
  "errors"?: Array<Error>;
  "cursor"?: string;
  "objects"?: Array<CatalogObject>;
  "related_objects"?: Array<CatalogObject>;
  "latest_time"?: string;
};

/** Defines the fields that are included in the request body of a request to the
`SearchCustomers` endpoint. */
export type SearchCustomersRequest = {
  "cursor"?: string;
  "limit"?: number;
  "query"?: CustomerQuery;
  "count"?: boolean;
};

/** 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). */
export type SearchCustomersResponse = {
  "errors"?: Array<Error>;
  "customers"?: Array<Customer>;
  "cursor"?: string;
  "count"?: number;
};

/** Criteria to filter events by. */
export type SearchEventsFilter = {
  "event_types"?: Array<string>;
  "merchant_ids"?: Array<string>;
  "location_ids"?: Array<string>;
  "created_at"?: TimeRange;
};

/** Contains query criteria for the search. */
export type SearchEventsQuery = {
  "filter"?: SearchEventsFilter;
  "sort"?: SearchEventsSort;
};

/** Searches [Event](entity:Event)s for your application. */
export type SearchEventsRequest = {
  "cursor"?: string;
  "limit"?: number;
  "query"?: SearchEventsQuery;
};

/** Defines the fields that are included in the response body of
a request to the [SearchEvents](api-endpoint:Events-SearchEvents) endpoint.

Note: if there are errors processing the request, the events field will not be
present. */
export type SearchEventsResponse = {
  "errors"?: Array<Error>;
  "events"?: Array<Event>;
  "metadata"?: Array<EventMetadata>;
  "cursor"?: string;
};

/** Criteria to sort events by. */
export type SearchEventsSort = {
  "field"?: SearchEventsSortField;
  "order"?: SortOrder;
};

/** Specifies the sort key for events returned from a search. */
export type SearchEventsSortField = "DEFAULT";

/** Describes a `SearchInvoices` request. */
export type SearchInvoicesRequest = {
  "query": InvoiceQuery;
  "limit"?: number;
  "cursor"?: string;
};

/** Describes a `SearchInvoices` response. */
export type SearchInvoicesResponse = {
  "invoices"?: Array<Invoice>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** A request to search for loyalty accounts. */
export type SearchLoyaltyAccountsRequest = {
  "query"?: SearchLoyaltyAccountsRequestLoyaltyAccountQuery;
  "limit"?: number;
  "cursor"?: string;
};

/** The search criteria for the loyalty accounts. */
export type SearchLoyaltyAccountsRequestLoyaltyAccountQuery = {
  "mappings"?: Array<LoyaltyAccountMapping>;
  "customer_ids"?: Array<string>;
};

/** A response that includes loyalty accounts that satisfy the search criteria. */
export type SearchLoyaltyAccountsResponse = {
  "errors"?: Array<Error>;
  "loyalty_accounts"?: Array<LoyaltyAccount>;
  "cursor"?: string;
};

/** A request to search for loyalty events. */
export type SearchLoyaltyEventsRequest = {
  "query"?: LoyaltyEventQuery;
  "limit"?: number;
  "cursor"?: string;
};

/** A response that contains loyalty events that satisfy the search 
criteria, in order by the `created_at` date. */
export type SearchLoyaltyEventsResponse = {
  "errors"?: Array<Error>;
  "events"?: Array<LoyaltyEvent>;
  "cursor"?: string;
};

/** A request to search for loyalty rewards. */
export type SearchLoyaltyRewardsRequest = {
  "query"?: SearchLoyaltyRewardsRequestLoyaltyRewardQuery;
  "limit"?: number;
  "cursor"?: string;
};

/** The set of search requirements. */
export type SearchLoyaltyRewardsRequestLoyaltyRewardQuery = {
  "loyalty_account_id": string;
  "status"?: LoyaltyRewardStatus;
};

/** A response that includes the loyalty rewards satisfying the search criteria. */
export type SearchLoyaltyRewardsResponse = {
  "errors"?: Array<Error>;
  "rewards"?: Array<LoyaltyReward>;
  "cursor"?: string;
};

/** 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](entity:FulfillmentRecipient) `customer_id`. */
export type SearchOrdersCustomerFilter = {
  "customer_ids"?: Array<string>;
};

/** 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](entity: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) */
export type SearchOrdersDateTimeFilter = {
  "created_at"?: TimeRange;
  "updated_at"?: TimeRange;
  "closed_at"?: TimeRange;
};

/** Filtering criteria to use for a `SearchOrders` request. Multiple filters
are ANDed together. */
export type SearchOrdersFilter = {
  "state_filter"?: SearchOrdersStateFilter;
  "date_time_filter"?: SearchOrdersDateTimeFilter;
  "fulfillment_filter"?: SearchOrdersFulfillmentFilter;
  "source_filter"?: SearchOrdersSourceFilter;
  "customer_filter"?: SearchOrdersCustomerFilter;
};

/** Filter based on [order fulfillment](entity:Fulfillment) information. */
export type SearchOrdersFulfillmentFilter = {
  "fulfillment_types"?: Array<FulfillmentType>;
  "fulfillment_states"?: Array<FulfillmentState>;
};

/** Contains query criteria for the search. */
export type SearchOrdersQuery = {
  "filter"?: SearchOrdersFilter;
  "sort"?: SearchOrdersSort;
};

export type SearchOrdersRequest = {
  "location_ids"?: Array<string>;
  "cursor"?: string;
  "query"?: SearchOrdersQuery;
  "limit"?: number;
  "return_entries"?: boolean;
};

/** Either the `order_entries` or `orders` field is set, depending on whether
`return_entries` is set on the [SearchOrdersRequest](api-endpoint:Orders-SearchOrders). */
export type SearchOrdersResponse = {
  "order_entries"?: Array<OrderEntry>;
  "orders"?: Array<Order>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Sorting criteria for a `SearchOrders` request. Results can only be sorted
by a timestamp field. */
export type SearchOrdersSort = {
  "sort_field": SearchOrdersSortField;
  "sort_order"?: SortOrder;
};

/** Specifies which timestamp to use to sort `SearchOrder` results. */
export type SearchOrdersSortField = "CREATED_AT" | "UPDATED_AT" | "CLOSED_AT";

/** A filter based on order `source` information. */
export type SearchOrdersSourceFilter = {
  "source_names"?: Array<string>;
};

/** Filter by the current order `state`. */
export type SearchOrdersStateFilter = {
  "states": Array<OrderState>;
};

/** Represents a [SearchScheduledShift](api-endpoint:Labor-SearchScheduledShift) request. */
export type SearchScheduledShiftsRequest = {
  "query"?: ScheduledShiftQuery;
  "limit"?: number;
  "cursor"?: string;
};

/** Represents a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) response.
Either `scheduled_shifts` or `errors` is present in the response. */
export type SearchScheduledShiftsResponse = {
  "scheduled_shifts"?: Array<ScheduledShift>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** A request for a filtered and sorted set of `Shift` objects. */
export type SearchShiftsRequest = {
  "query"?: ShiftQuery;
  "limit"?: number;
  "cursor"?: string;
};

/** The response to a request for `Shift` objects. The response contains
the requested `Shift` objects and might contain a set of `Error` objects if
the request resulted in errors. */
export type SearchShiftsResponse = {
  "shifts"?: Array<Shift>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by 
the [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint. */
export type SearchSubscriptionsFilter = {
  "customer_ids"?: Array<string>;
  "location_ids"?: Array<string>;
  "source_names"?: Array<string>;
};

/** Represents a query, consisting of specified query expressions, used to search for subscriptions. */
export type SearchSubscriptionsQuery = {
  "filter"?: SearchSubscriptionsFilter;
};

/** Defines input parameters in a request to the 
[SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint. */
export type SearchSubscriptionsRequest = {
  "cursor"?: string;
  "limit"?: number;
  "query"?: SearchSubscriptionsQuery;
  "include"?: Array<string>;
};

/** Defines output parameters in a response from the
[SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint. */
export type SearchSubscriptionsResponse = {
  "errors"?: Array<Error>;
  "subscriptions"?: Array<Subscription>;
  "cursor"?: string;
};

/** Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied
between the individual fields, and `OR` logic is applied within list-based fields.
For example, setting this filter value:
```
filter = (locations_ids = ["A", "B"], status = ACTIVE)
```
returns only active team members assigned to either location "A" or "B". */
export type SearchTeamMembersFilter = {
  "location_ids"?: Array<string>;
  "status"?: TeamMemberStatus;
  "is_owner"?: boolean;
};

/** Represents the parameters in a search for `TeamMember` objects. */
export type SearchTeamMembersQuery = {
  "filter"?: SearchTeamMembersFilter;
};

/** Represents a search request for a filtered list of `TeamMember` objects. */
export type SearchTeamMembersRequest = {
  "query"?: SearchTeamMembersQuery;
  "limit"?: number;
  "cursor"?: string;
};

/** Represents a response from a search request containing a filtered list of `TeamMember` objects. */
export type SearchTeamMembersResponse = {
  "team_members"?: Array<TeamMember>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

export type SearchTerminalActionsRequest = {
  "query"?: TerminalActionQuery;
  "cursor"?: string;
  "limit"?: number;
};

export type SearchTerminalActionsResponse = {
  "errors"?: Array<Error>;
  "action"?: Array<TerminalAction>;
  "cursor"?: string;
};

export type SearchTerminalCheckoutsRequest = {
  "query"?: TerminalCheckoutQuery;
  "cursor"?: string;
  "limit"?: number;
};

export type SearchTerminalCheckoutsResponse = {
  "errors"?: Array<Error>;
  "checkouts"?: Array<TerminalCheckout>;
  "cursor"?: string;
};

export type SearchTerminalRefundsRequest = {
  "query"?: TerminalRefundQuery;
  "cursor"?: string;
  "limit"?: number;
};

export type SearchTerminalRefundsResponse = {
  "errors"?: Array<Error>;
  "refunds"?: Array<TerminalRefund>;
  "cursor"?: string;
};

/** A request for a filtered and sorted set of `Timecard` objects. */
export type SearchTimecardsRequest = {
  "query"?: TimecardQuery;
  "limit"?: number;
  "cursor"?: string;
};

/** The response to a request for `Timecard` objects. The response contains
the requested `Timecard` objects and might contain a set of `Error` objects if
the request resulted in errors. */
export type SearchTimecardsResponse = {
  "timecards"?: Array<Timecard>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Request to search transfer orders */
export type SearchTransferOrdersRequest = {
  "query"?: TransferOrderQuery;
  "cursor"?: string;
  "limit"?: number;
};

/** Response for searching transfer orders */
export type SearchTransferOrdersResponse = {
  "transfer_orders"?: Array<TransferOrder>;
  "cursor"?: string;
  "errors"?: Array<Error>;
};

/** Represents an input into a call to [SearchVendors](api-endpoint:Vendors-SearchVendors). */
export type SearchVendorsRequest = {
  "filter"?: SearchVendorsRequestFilter;
  "sort"?: SearchVendorsRequestSort;
  "cursor"?: string;
};

/** Defines supported query expressions to search for vendors by. */
export type SearchVendorsRequestFilter = {
  "name"?: Array<string>;
  "status"?: Array<VendorStatus>;
};

/** Defines a sorter used to sort results from [SearchVendors](api-endpoint:Vendors-SearchVendors). */
export type SearchVendorsRequestSort = {
  "field"?: SearchVendorsRequestSortField;
  "order"?: SortOrder;
};

/** The field to sort the returned [Vendor](entity:Vendor) objects by. */
export type SearchVendorsRequestSortField = "NAME" | "CREATED_AT";

/** Represents an output from a call to [SearchVendors](api-endpoint:Vendors-SearchVendors). */
export type SearchVendorsResponse = {
  "errors"?: Array<Error>;
  "vendors"?: Array<Vendor>;
  "cursor"?: string;
};

/** A query filter to search for buyer-accessible appointment segments by. */
export type SegmentFilter = {
  "service_variation_id": string;
  "team_member_id_filter"?: FilterValue;
};

export type SelectOption = {
  "reference_id": string;
  "title": string;
};

export type SelectOptions = {
  "title": string;
  "body": string;
  "options": Array<SelectOption>;
  "selected_option"?: SelectOption;
};

/** A record of the hourly rate, start, and end times for a single work shift
for an employee. This might include a record of the start and end times for breaks
taken during the shift.

Deprecated at Square API version 2025-05-21. Replaced by [Timecard](entity:Timecard).
See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type Shift = {
  "id"?: string;
  "employee_id"?: string;
  "location_id": string;
  "timezone"?: string;
  "start_at": string;
  "end_at"?: string;
  "wage"?: ShiftWage;
  "breaks"?: Array<Break>;
  "status"?: ShiftStatus;
  "version"?: number;
  "created_at"?: string;
  "updated_at"?: string;
  "team_member_id"?: string;
  "declared_cash_tip_money"?: Money;
};

/** Defines a filter used in a search for `Shift` records. `AND` logic is
used by Square's servers to apply each filter property specified.

Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type ShiftFilter = {
  "location_ids"?: Array<string>;
  "employee_ids"?: Array<string>;
  "status"?: ShiftFilterStatus;
  "start"?: TimeRange;
  "end"?: TimeRange;
  "workday"?: ShiftWorkday;
  "team_member_ids"?: Array<string>;
};

/** Specifies the `status` of `Shift` records to be returned.

Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type ShiftFilterStatus = "OPEN" | "CLOSED";

/** The parameters of a `Shift` search query, which includes filter and sort options.

Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type ShiftQuery = {
  "filter"?: ShiftFilter;
  "sort"?: ShiftSort;
};

/** Sets the sort order of search results.

Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type ShiftSort = {
  "field"?: ShiftSortField;
  "order"?: SortOrder;
};

/** Enumerates the `Shift` fields to sort on.

Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type ShiftSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT";

/** Enumerates the possible status of a `Shift`.

Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type ShiftStatus = "OPEN" | "CLOSED";

/** The hourly wage rate used to compensate an employee for this shift.

Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type ShiftWage = {
  "title"?: string;
  "hourly_rate"?: Money;
  "job_id"?: string;
  "tip_eligible"?: boolean;
};

/** A `Shift` search query filter parameter that sets a range of days that
a `Shift` must start or end in before passing the filter condition.

Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */
export type ShiftWorkday = {
  "date_range"?: DateRange;
  "match_shifts_by"?: ShiftWorkdayMatcher;
  "default_timezone"?: string;
};

/** Defines the logic used to apply a workday filter. */
export type ShiftWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION";

export type ShippingFee = {
  "name"?: string;
  "charge": Money;
};

export type SignatureImage = {
  "image_type"?: string;
  "data"?: string;
};

export type SignatureOptions = {
  "title": string;
  "body": string;
  "signature"?: Array<SignatureImage>;
};

/** Represents a Square Online site, which is an online store for a Square seller. */
export type Site = {
  "id"?: string;
  "site_title"?: string;
  "domain"?: string;
  "is_published"?: boolean;
  "created_at"?: string;
  "updated_at"?: string;
};

/** Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. */
export type Snippet = {
  "id"?: string;
  "site_id"?: string;
  "content": string;
  "created_at"?: string;
  "updated_at"?: string;
};

/** The order (e.g., chronological or alphabetical) in which results from a request are returned. */
export type SortOrder = "DESC" | "ASC";

/** Represents information about the application used to generate a change. */
export type SourceApplication = {
  "product"?: Product;
  "application_id"?: string;
  "name"?: string;
};

/** Additional details about Square Account payments. */
export type SquareAccountDetails = {
  "payment_source_token"?: string;
  "errors"?: Array<Error>;
};

/** Contains the name and abbreviation for standard measurement unit. */
export type StandardUnitDescription = {
  "unit"?: MeasurementUnit;
  "name"?: string;
  "abbreviation"?: string;
};

/** Group of standard measurement units. */
export type StandardUnitDescriptionGroup = {
  "standard_unit_descriptions"?: Array<StandardUnitDescription>;
  "language_code"?: string;
};

/** Request to start a transfer order, changing its status from DRAFT to STARTED. */
export type StartTransferOrderRequest = {
  "idempotency_key": string;
  "version"?: number;
};

/** Response for starting a transfer order. */
export type StartTransferOrderResponse = {
  "transfer_order"?: TransferOrder;
  "errors"?: Array<Error>;
};

/** Defines the fields in a `SubmitEvidence` response. */
export type SubmitEvidenceResponse = {
  "errors"?: Array<Error>;
  "dispute"?: Dispute;
};

/** Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */
export type Subscription = {
  "id"?: string;
  "location_id"?: string;
  "plan_variation_id"?: string;
  "customer_id"?: string;
  "start_date"?: string;
  "canceled_date"?: string;
  "charged_through_date"?: string;
  "status"?: SubscriptionStatus;
  "tax_percentage"?: string;
  "invoice_ids"?: Array<string>;
  "price_override_money"?: Money;
  "version"?: number;
  "created_at"?: string;
  "card_id"?: string;
  "timezone"?: string;
  "source"?: SubscriptionSource;
  "actions"?: Array<SubscriptionAction>;
  "monthly_billing_anchor_date"?: number;
  "phases"?: Array<Phase>;
  "completed_date"?: string;
};

/** Represents an action as a pending change to a subscription. */
export type SubscriptionAction = {
  "id"?: string;
  "type"?: SubscriptionActionType;
  "effective_date"?: string;
  "monthly_billing_anchor_date"?: number;
  "phases"?: Array<Phase>;
  "new_plan_variation_id"?: string;
};

/** Supported types of an action as a pending change to a subscription. */
export type SubscriptionActionType = "CANCEL" | "PAUSE" | "RESUME" | "SWAP_PLAN" | "CHANGE_BILLING_ANCHOR_DATE" | "COMPLETE";

/** Determines the billing cadence of a [Subscription](entity:Subscription) */
export type SubscriptionCadence = "DAILY" | "WEEKLY" | "EVERY_TWO_WEEKS" | "THIRTY_DAYS" | "SIXTY_DAYS" | "NINETY_DAYS" | "MONTHLY" | "EVERY_TWO_MONTHS" | "QUARTERLY" | "EVERY_FOUR_MONTHS" | "EVERY_SIX_MONTHS" | "ANNUAL" | "EVERY_TWO_YEARS";

/** Published when a [Subscription](entity:Subscription) is created. */
export type SubscriptionCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: SubscriptionCreatedEventData;
};

export type SubscriptionCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: SubscriptionCreatedEventObject;
};

export type SubscriptionCreatedEventObject = {
  "subscription"?: Subscription;
};

/** Describes changes to a subscription and the subscription status. */
export type SubscriptionEvent = {
  "id": string;
  "subscription_event_type": SubscriptionEventSubscriptionEventType;
  "effective_date": string;
  "monthly_billing_anchor_date"?: number;
  "info"?: SubscriptionEventInfo;
  "phases"?: Array<Phase>;
  "plan_variation_id": string;
};

/** Provides information about the subscription event. */
export type SubscriptionEventInfo = {
  "detail"?: string;
  "code"?: SubscriptionEventInfoCode;
};

/** Supported info codes of a subscription event. */
export type SubscriptionEventInfoCode = "LOCATION_NOT_ACTIVE" | "LOCATION_CANNOT_ACCEPT_PAYMENT" | "CUSTOMER_DELETED" | "CUSTOMER_NO_EMAIL" | "CUSTOMER_NO_NAME" | "USER_PROVIDED";

/** Supported types of an event occurred to a subscription. */
export type SubscriptionEventSubscriptionEventType = "START_SUBSCRIPTION" | "PLAN_CHANGE" | "STOP_SUBSCRIPTION" | "DEACTIVATE_SUBSCRIPTION" | "RESUME_SUBSCRIPTION" | "PAUSE_SUBSCRIPTION" | "BILLING_ANCHOR_DATE_CHANGED";

/** Describes a phase in a subscription plan variation. For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). */
export type SubscriptionPhase = {
  "uid"?: string;
  "cadence": SubscriptionCadence;
  "periods"?: number;
  "recurring_price_money"?: Money;
  "ordinal"?: number;
  "pricing"?: SubscriptionPricing;
};

/** Describes the pricing for the subscription. */
export type SubscriptionPricing = {
  "type"?: SubscriptionPricingType;
  "discount_ids"?: Array<string>;
  "price_money"?: Money;
};

/** Determines the pricing of a [Subscription](entity:Subscription) */
export type SubscriptionPricingType = "STATIC" | "RELATIVE";

/** The origination details of the subscription. */
export type SubscriptionSource = {
  "name"?: string;
};

/** Supported subscription statuses. */
export type SubscriptionStatus = "PENDING" | "ACTIVE" | "CANCELED" | "DEACTIVATED" | "PAUSED" | "COMPLETED";

/** Represents the details of a webhook subscription, including notification URL,
event types, and signature key. */
export type SubscriptionTestResult = {
  "id"?: string;
  "status_code"?: number;
  "payload"?: string;
  "created_at"?: string;
  "updated_at"?: string;
};

/** Published when a [Subscription](entity:Subscription) is updated.
Typically the `subscription.status` is updated as subscriptions become active
or cancelled. */
export type SubscriptionUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: SubscriptionUpdatedEventData;
};

export type SubscriptionUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: SubscriptionUpdatedEventObject;
};

export type SubscriptionUpdatedEventObject = {
  "subscription"?: Subscription;
};

/** Defines input parameters in a call to the
[SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint. */
export type SwapPlanRequest = {
  "new_plan_variation_id"?: string;
  "phases"?: Array<PhaseInput>;
};

/** Defines output parameters in a response of the 
[SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint. */
export type SwapPlanResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
  "actions"?: Array<SubscriptionAction>;
};

/** When to calculate the taxes due on a cart. */
export type TaxCalculationPhase = "TAX_SUBTOTAL_PHASE" | "TAX_TOTAL_PHASE";

/** Identifiers for the location used by various governments for tax purposes. */
export type TaxIds = {
  "eu_vat"?: string;
  "fr_siret"?: string;
  "fr_naf"?: string;
  "es_nif"?: string;
  "jp_qii"?: string;
};

/** Whether to the tax amount should be additional to or included in the CatalogItem price. */
export type TaxInclusionType = "ADDITIVE" | "INCLUSIVE";

/** A record representing an individual team member for a business. */
export type TeamMember = {
  "id"?: string;
  "reference_id"?: string;
  "is_owner"?: boolean;
  "status"?: TeamMemberStatus;
  "given_name"?: string;
  "family_name"?: string;
  "email_address"?: string;
  "phone_number"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "assigned_locations"?: TeamMemberAssignedLocations;
  "wage_setting"?: WageSetting;
};

/** An object that represents a team member's assignment to locations. */
export type TeamMemberAssignedLocations = {
  "assignment_type"?: TeamMemberAssignedLocationsAssignmentType;
  "location_ids"?: Array<string>;
};

/** Enumerates the possible assignment types that the team member can have. */
export type TeamMemberAssignedLocationsAssignmentType = "ALL_CURRENT_AND_FUTURE_LOCATIONS" | "EXPLICIT_LOCATIONS";

/** The booking profile of a seller's team member, including the team member's ID, display name, description and whether the team member can be booked as a service provider. */
export type TeamMemberBookingProfile = {
  "team_member_id"?: string;
  "description"?: string;
  "display_name"?: string;
  "is_bookable"?: boolean;
  "profile_image_url"?: string;
};

/** Published when a Team Member is created. */
export type TeamMemberCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TeamMemberCreatedEventData;
};

export type TeamMemberCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TeamMemberCreatedEventObject;
};

export type TeamMemberCreatedEventObject = {
  "team_member"?: TeamMember;
};

/** Enumerates the possible invitation statuses the team member can have within a business. */
export type TeamMemberInvitationStatus = "UNINVITED" | "PENDING" | "ACCEPTED";

/** Enumerates the possible statuses the team member can have within a business. */
export type TeamMemberStatus = "ACTIVE" | "INACTIVE";

/** Published when a Team Member is updated. */
export type TeamMemberUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TeamMemberUpdatedEventData;
};

export type TeamMemberUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TeamMemberUpdatedEventObject;
};

export type TeamMemberUpdatedEventObject = {
  "team_member"?: TeamMember;
};

/** Job and wage information for a [team member](entity:TeamMember).
This convenience object provides details needed to specify the `wage`
field for a [timecard](entity:Timecard). */
export type TeamMemberWage = {
  "id"?: string;
  "team_member_id"?: string;
  "title"?: string;
  "hourly_rate"?: Money;
  "job_id"?: string;
  "tip_eligible"?: boolean;
};

/** Published when a Wage Setting is updated. */
export type TeamMemberWageSettingUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TeamMemberWageSettingUpdatedEventData;
};

export type TeamMemberWageSettingUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TeamMemberWageSettingUpdatedEventObject;
};

export type TeamMemberWageSettingUpdatedEventObject = {
  "wage_setting"?: WageSetting;
};

/** Represents a tender (i.e., a method of payment) used in a Square transaction. */
export type Tender = {
  "id"?: string;
  "location_id"?: string;
  "transaction_id"?: string;
  "created_at"?: string;
  "note"?: string;
  "amount_money"?: Money;
  "tip_money"?: Money;
  "processing_fee_money"?: Money;
  "customer_id"?: string;
  "type": TenderType;
  "card_details"?: TenderCardDetails;
  "cash_details"?: TenderCashDetails;
  "bank_account_details"?: TenderBankAccountDetails;
  "buy_now_pay_later_details"?: TenderBuyNowPayLaterDetails;
  "square_account_details"?: TenderSquareAccountDetails;
  "additional_recipients"?: Array<AdditionalRecipient>;
  "payment_id"?: string;
};

/** Represents the details of a tender with `type` `BANK_ACCOUNT`.

See [BankAccountPaymentDetails](entity:BankAccountPaymentDetails)
for more exposed details of a bank account payment. */
export type TenderBankAccountDetails = {
  "status"?: TenderBankAccountDetailsStatus;
};

/** Indicates the bank account payment's current status. */
export type TenderBankAccountDetailsStatus = "PENDING" | "COMPLETED" | "FAILED";

/** Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. */
export type TenderBuyNowPayLaterDetails = {
  "buy_now_pay_later_brand"?: TenderBuyNowPayLaterDetailsBrand;
  "status"?: TenderBuyNowPayLaterDetailsStatus;
};

export type TenderBuyNowPayLaterDetailsBrand = "OTHER_BRAND" | "AFTERPAY";

export type TenderBuyNowPayLaterDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED";

/** Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` */
export type TenderCardDetails = {
  "status"?: TenderCardDetailsStatus;
  "card"?: Card;
  "entry_method"?: TenderCardDetailsEntryMethod;
};

/** Indicates the method used to enter the card's details. */
export type TenderCardDetailsEntryMethod = "SWIPED" | "KEYED" | "EMV" | "ON_FILE" | "CONTACTLESS";

/** Indicates the card transaction's current status. */
export type TenderCardDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED";

/** Represents the details of a tender with `type` `CASH`. */
export type TenderCashDetails = {
  "buyer_tendered_money"?: Money;
  "change_back_money"?: Money;
};

/** Represents the details of a tender with `type` `SQUARE_ACCOUNT`. */
export type TenderSquareAccountDetails = {
  "status"?: TenderSquareAccountDetailsStatus;
};

export type TenderSquareAccountDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED";

/** Indicates a tender's type. */
export type TenderType = "CARD" | "CASH" | "THIRD_PARTY_CARD" | "SQUARE_GIFT_CARD" | "NO_SALE" | "BANK_ACCOUNT" | "WALLET" | "BUY_NOW_PAY_LATER" | "SQUARE_ACCOUNT" | "OTHER";

/** Represents an action processed by the Square Terminal. */
export type TerminalAction = {
  "id"?: string;
  "device_id"?: string;
  "deadline_duration"?: string;
  "status"?: string;
  "cancel_reason"?: ActionCancelReason;
  "created_at"?: string;
  "updated_at"?: string;
  "app_id"?: string;
  "location_id"?: string;
  "type"?: TerminalActionActionType;
  "qr_code_options"?: QrCodeOptions;
  "save_card_options"?: SaveCardOptions;
  "signature_options"?: SignatureOptions;
  "confirmation_options"?: ConfirmationOptions;
  "receipt_options"?: ReceiptOptions;
  "data_collection_options"?: DataCollectionOptions;
  "select_options"?: SelectOptions;
  "device_metadata"?: DeviceMetadata;
  "await_next_action"?: boolean;
  "await_next_action_duration"?: string;
};

/** Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. */
export type TerminalActionActionType = "QR_CODE" | "PING" | "SAVE_CARD" | "SIGNATURE" | "CONFIRMATION" | "RECEIPT" | "DATA_COLLECTION" | "SELECT";

/** Published when a TerminalAction is created. */
export type TerminalActionCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TerminalActionCreatedEventData;
};

export type TerminalActionCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TerminalActionCreatedEventObject;
};

export type TerminalActionCreatedEventObject = {
  "action"?: TerminalAction;
};

export type TerminalActionQuery = {
  "filter"?: TerminalActionQueryFilter;
  "sort"?: TerminalActionQuerySort;
};

export type TerminalActionQueryFilter = {
  "device_id"?: string;
  "created_at"?: TimeRange;
  "status"?: string;
  "type"?: TerminalActionActionType;
};

export type TerminalActionQuerySort = {
  "sort_order"?: SortOrder;
};

/** Published when a TerminalAction is updated. */
export type TerminalActionUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TerminalActionUpdatedEventData;
};

export type TerminalActionUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TerminalActionUpdatedEventObject;
};

export type TerminalActionUpdatedEventObject = {
  "action"?: TerminalAction;
};

/** Represents a checkout processed by the Square Terminal. */
export type TerminalCheckout = {
  "id"?: string;
  "amount_money": Money;
  "reference_id"?: string;
  "note"?: string;
  "order_id"?: string;
  "payment_options"?: PaymentOptions;
  "device_options": DeviceCheckoutOptions;
  "deadline_duration"?: string;
  "status"?: string;
  "cancel_reason"?: ActionCancelReason;
  "payment_ids"?: Array<string>;
  "created_at"?: string;
  "updated_at"?: string;
  "app_id"?: string;
  "location_id"?: string;
  "payment_type"?: CheckoutOptionsPaymentType;
  "team_member_id"?: string;
  "customer_id"?: string;
  "app_fee_money"?: Money;
  "statement_description_identifier"?: string;
  "tip_money"?: Money;
};

/** Published when a [TerminalCheckout](entity:TerminalCheckout) is created. */
export type TerminalCheckoutCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TerminalCheckoutCreatedEventData;
};

export type TerminalCheckoutCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TerminalCheckoutCreatedEventObject;
};

export type TerminalCheckoutCreatedEventObject = {
  "checkout"?: TerminalCheckout;
};

export type TerminalCheckoutQuery = {
  "filter"?: TerminalCheckoutQueryFilter;
  "sort"?: TerminalCheckoutQuerySort;
};

export type TerminalCheckoutQueryFilter = {
  "device_id"?: string;
  "created_at"?: TimeRange;
  "status"?: string;
};

export type TerminalCheckoutQuerySort = {
  "sort_order"?: SortOrder;
};

/** Published when a [TerminalCheckout](entity:TerminalCheckout) is updated. */
export type TerminalCheckoutUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TerminalCheckoutUpdatedEventData;
};

export type TerminalCheckoutUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TerminalCheckoutUpdatedEventObject;
};

export type TerminalCheckoutUpdatedEventObject = {
  "checkout"?: TerminalCheckout;
};

/** Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. */
export type TerminalRefund = {
  "id"?: string;
  "refund_id"?: string;
  "payment_id": string;
  "order_id"?: string;
  "amount_money": Money;
  "reason": string;
  "device_id": string;
  "deadline_duration"?: string;
  "status"?: string;
  "cancel_reason"?: ActionCancelReason;
  "created_at"?: string;
  "updated_at"?: string;
  "app_id"?: string;
  "location_id"?: string;
};

/** Published when a Terminal API refund is created. */
export type TerminalRefundCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TerminalRefundCreatedEventData;
};

export type TerminalRefundCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TerminalRefundCreatedEventObject;
};

export type TerminalRefundCreatedEventObject = {
  "refund"?: TerminalRefund;
};

export type TerminalRefundQuery = {
  "filter"?: TerminalRefundQueryFilter;
  "sort"?: TerminalRefundQuerySort;
};

export type TerminalRefundQueryFilter = {
  "device_id"?: string;
  "created_at"?: TimeRange;
  "status"?: string;
};

export type TerminalRefundQuerySort = {
  "sort_order"?: string;
};

/** Published when a Terminal API refund is updated. */
export type TerminalRefundUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TerminalRefundUpdatedEventData;
};

export type TerminalRefundUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TerminalRefundUpdatedEventObject;
};

export type TerminalRefundUpdatedEventObject = {
  "refund"?: TerminalRefund;
};

/** Tests a [Subscription](entity:WebhookSubscription) by sending a test event to its notification URL. */
export type TestWebhookSubscriptionRequest = {
  "event_type"?: string;
};

/** Defines the fields that are included in the response body of
a request to the [TestWebhookSubscription](api-endpoint:WebhookSubscriptions-TestWebhookSubscription) endpoint.

Note: If there are errors processing the request, the [SubscriptionTestResult](entity:SubscriptionTestResult) field is not
present. */
export type TestWebhookSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription_test_result"?: SubscriptionTestResult;
};

/** 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. */
export type TimeRange = {
  "start_at"?: string;
  "end_at"?: string;
};

/** A record of the hourly rate, start time, and end time of a single timecard (shift)
for a team member. This might include a record of the start and end times of breaks
taken during the shift. */
export type Timecard = {
  "id"?: string;
  "location_id": string;
  "timezone"?: string;
  "start_at": string;
  "end_at"?: string;
  "wage"?: TimecardWage;
  "breaks"?: Array<Break>;
  "status"?: TimecardStatus;
  "version"?: number;
  "created_at"?: string;
  "updated_at"?: string;
  "team_member_id": string;
  "declared_cash_tip_money"?: Money;
};

/** Defines a filter used in a search for `Timecard` records. `AND` logic is
used by Square's servers to apply each filter property specified. */
export type TimecardFilter = {
  "location_ids"?: Array<string>;
  "status"?: TimecardFilterStatus;
  "start"?: TimeRange;
  "end"?: TimeRange;
  "workday"?: TimecardWorkday;
  "team_member_ids"?: Array<string>;
};

/** Specifies the `status` of `Timecard` records to be returned. */
export type TimecardFilterStatus = "OPEN" | "CLOSED";

/** The parameters of a `Timecard` search query, which includes filter and sort options. */
export type TimecardQuery = {
  "filter"?: TimecardFilter;
  "sort"?: TimecardSort;
};

/** Sets the sort order of search results. */
export type TimecardSort = {
  "field"?: TimecardSortField;
  "order"?: SortOrder;
};

/** Enumerates the `Timecard` fields to sort on. */
export type TimecardSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT";

/** **Read only** Enumerates the possible status of a [timecard](entity:Timecard). */
export type TimecardStatus = "OPEN" | "CLOSED";

/** The hourly wage rate used to compensate a team member for a [timecard](entity:Timecard). */
export type TimecardWage = {
  "title"?: string;
  "hourly_rate"?: Money;
  "job_id"?: string;
  "tip_eligible"?: boolean;
};

/** A `Timecard` search query filter parameter that sets a range of days that
a `Timecard` must start or end in before passing the filter condition. */
export type TimecardWorkday = {
  "date_range"?: DateRange;
  "match_timecards_by"?: TimecardWorkdayMatcher;
  "default_timezone"?: string;
};

/** Defines the logic used to apply a workday filter. */
export type TimecardWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION";

export type TipSettings = {
  "allow_tipping"?: boolean;
  "separate_tip_screen"?: boolean;
  "custom_tip_field"?: boolean;
  "tip_percentages"?: Array<number>;
  "smart_tipping"?: boolean;
};

/** 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. */
export type Transaction = {
  "id"?: string;
  "location_id"?: string;
  "created_at"?: string;
  "tenders"?: Array<Tender>;
  "refunds"?: Array<Refund>;
  "reference_id"?: string;
  "product"?: TransactionProduct;
  "client_id"?: string;
  "shipping_address"?: Address;
  "order_id"?: string;
};

/** Indicates the Square product used to process a transaction. */
export type TransactionProduct = "REGISTER" | "EXTERNAL_API" | "BILLING" | "APPOINTMENTS" | "INVOICES" | "ONLINE_STORE" | "PAYROLL" | "OTHER";

/** The transaction type used in the disputed payment. */
export type TransactionType = "DEBIT" | "CREDIT";

/** Represents a transfer order for moving [CatalogItemVariation](entity:CatalogItemVariation)s 
between [Location](entity:Location)s. Transfer orders track the entire lifecycle of an inventory 
transfer, including:
- What items and quantities are being moved
- Source and destination locations
- Current [TransferOrderStatus](entity:TransferOrderStatus)
- Shipping information and tracking
- Which [TeamMember](entity:TeamMember) initiated the transfer

This object is commonly used to:
- Track [CatalogItemVariation](entity:CatalogItemVariation) movements between [Location](entity:Location)s
- Reconcile expected vs received quantities
- Monitor transfer progress and shipping status
- Audit inventory movement history */
export type TransferOrder = {
  "id"?: string;
  "source_location_id"?: string;
  "destination_location_id"?: string;
  "status"?: TransferOrderStatus;
  "created_at"?: string;
  "updated_at"?: string;
  "expected_at"?: string;
  "completed_at"?: string;
  "notes"?: string;
  "tracking_number"?: string;
  "created_by_team_member_id"?: string;
  "line_items"?: Array<TransferOrderLine>;
  "version"?: number;
};

/** Published when a transfer_order is created. */
export type TransferOrderCreatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TransferOrderCreatedEventData;
};

export type TransferOrderCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TransferOrderCreatedEventObject;
};

export type TransferOrderCreatedEventObject = {
  "transfer_order"?: TransferOrder;
};

/** Published when a transfer_order is deleted. */
export type TransferOrderDeletedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TransferOrderDeletedEventData;
};

export type TransferOrderDeletedEventData = {
  "type"?: string;
  "id"?: string;
  "deleted"?: boolean;
};

/** Filter criteria for searching transfer orders */
export type TransferOrderFilter = {
  "source_location_ids"?: Array<string>;
  "destination_location_ids"?: Array<string>;
  "statuses"?: Array<TransferOrderStatus>;
};

/** The goods receipt details for a transfer order. This object represents a single receipt
of goods against a transfer order, tracking:

- Which [CatalogItemVariation](entity:CatalogItemVariation)s were received
- Quantities received in good condition
- Quantities damaged during transit/handling
- Quantities canceled during receipt

Multiple goods receipts can be created for a single transfer order to handle:
- Partial deliveries
- Multiple shipments
- Split receipts across different dates
- Cancellations of specific quantities

Each receipt automatically:
- Updates the transfer order status
- Adjusts received quantities
- Updates inventory levels at both source and destination [Location](entity:Location)s */
export type TransferOrderGoodsReceipt = {
  "line_items"?: Array<TransferOrderGoodsReceiptLineItem>;
};

/** A simplified line item for goods receipts in transfer orders */
export type TransferOrderGoodsReceiptLineItem = {
  "transfer_order_line_uid": string;
  "quantity_received"?: string;
  "quantity_damaged"?: string;
  "quantity_canceled"?: string;
};

/** Represents a line item in a transfer order. Each line item tracks a specific 
[CatalogItemVariation](entity:CatalogItemVariation) being transferred, including ordered quantities
and receipt status. */
export type TransferOrderLine = {
  "uid"?: string;
  "item_variation_id": string;
  "quantity_ordered": string;
  "quantity_pending"?: string;
  "quantity_received"?: string;
  "quantity_damaged"?: string;
  "quantity_canceled"?: string;
};

/** Query parameters for searching transfer orders */
export type TransferOrderQuery = {
  "filter"?: TransferOrderFilter;
  "sort"?: TransferOrderSort;
};

/** Sort configuration for search results */
export type TransferOrderSort = {
  "field"?: TransferOrderSortField;
  "order"?: SortOrder;
};

/** Fields that can be used for sorting [TransferOrder](entity:TransferOrder)s in search results.
Used with [SearchTransferOrders](api-endpoint:TransferOrders-SearchTransferOrders) to control
the order of returned results. */
export type TransferOrderSortField = "CREATED_AT" | "UPDATED_AT";

/** Status values for transfer orders. Represents the current state of a 
[TransferOrder](entity:TransferOrder) in its lifecycle from creation to completion.
Each status determines what actions are available and how inventory is affected. */
export type TransferOrderStatus = "DRAFT" | "STARTED" | "PARTIALLY_RECEIVED" | "COMPLETED" | "CANCELED";

/** Published when a transfer_order is updated. */
export type TransferOrderUpdatedEvent = {
  "merchant_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: TransferOrderUpdatedEventData;
};

export type TransferOrderUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: TransferOrderUpdatedEventObject;
};

export type TransferOrderUpdatedEventObject = {
  "transfer_order"?: TransferOrder;
};

/** A request to unlink a customer from a gift card. */
export type UnlinkCustomerFromGiftCardRequest = {
  "customer_id": string;
};

/** A response that contains the unlinked `GiftCard` object. If the request resulted in errors, 
the response contains a set of `Error` objects. */
export type UnlinkCustomerFromGiftCardResponse = {
  "errors"?: Array<Error>;
  "gift_card"?: GiftCard;
};

/** Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) request. */
export type UpdateBookingCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type UpdateBookingCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

export type UpdateBookingRequest = {
  "idempotency_key"?: string;
  "booking": Booking;
};

export type UpdateBookingResponse = {
  "booking"?: Booking;
  "errors"?: Array<Error>;
};

/** A request to update a `BreakType`. */
export type UpdateBreakTypeRequest = {
  "break_type": BreakType;
};

/** A response to a request to update a `BreakType`. The response contains
the requested `BreakType` objects and might contain a set of `Error` objects if
the request resulted in errors. */
export type UpdateBreakTypeResponse = {
  "break_type"?: BreakType;
  "errors"?: Array<Error>;
};

export type UpdateCatalogImageRequest = {
  "idempotency_key": string;
};

export type UpdateCatalogImageResponse = {
  "errors"?: Array<Error>;
  "image"?: CatalogObject;
};

/** Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) request. */
export type UpdateCustomerCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type UpdateCustomerCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Defines the body parameters that can be included in a request to the
[UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) endpoint. */
export type UpdateCustomerGroupRequest = {
  "group": CustomerGroup;
};

/** Defines the fields that are included in the response body of
a request to the [UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) endpoint.

Either `errors` or `group` is present in a given response (never both). */
export type UpdateCustomerGroupResponse = {
  "errors"?: Array<Error>;
  "group"?: CustomerGroup;
};

/** Defines the body parameters that can be included in a request to the
`UpdateCustomer` endpoint. */
export type UpdateCustomerRequest = {
  "given_name"?: string;
  "family_name"?: string;
  "company_name"?: string;
  "nickname"?: string;
  "email_address"?: string;
  "address"?: Address;
  "phone_number"?: string;
  "reference_id"?: string;
  "note"?: string;
  "birthday"?: string;
  "version"?: number;
  "tax_ids"?: CustomerTaxIds;
};

/** Defines the fields that are included in the response body of
a request to the [UpdateCustomer](api-endpoint:Customers-UpdateCustomer) or
[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.

Either `errors` or `customer` is present in a given response (never both). */
export type UpdateCustomerResponse = {
  "errors"?: Array<Error>;
  "customer"?: Customer;
};

/** Describes a `UpdateInvoice` request. */
export type UpdateInvoiceRequest = {
  "invoice": Invoice;
  "idempotency_key"?: string;
  "fields_to_clear"?: Array<string>;
};

/** Describes a `UpdateInvoice` response. */
export type UpdateInvoiceResponse = {
  "invoice"?: Invoice;
  "errors"?: Array<Error>;
};

export type UpdateItemModifierListsRequest = {
  "item_ids": Array<string>;
  "modifier_lists_to_enable"?: Array<string>;
  "modifier_lists_to_disable"?: Array<string>;
};

export type UpdateItemModifierListsResponse = {
  "errors"?: Array<Error>;
  "updated_at"?: string;
};

export type UpdateItemTaxesRequest = {
  "item_ids": Array<string>;
  "taxes_to_enable"?: Array<string>;
  "taxes_to_disable"?: Array<string>;
};

export type UpdateItemTaxesResponse = {
  "errors"?: Array<Error>;
  "updated_at"?: string;
};

/** Represents an [UpdateJob](api-endpoint:Team-UpdateJob) request. */
export type UpdateJobRequest = {
  "job": Job;
};

/** Represents an [UpdateJob](api-endpoint:Team-UpdateJob) response. Either `job` or `errors`
is present in the response. */
export type UpdateJobResponse = {
  "job"?: Job;
  "errors"?: Array<Error>;
};

/** Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) request. */
export type UpdateLocationCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type UpdateLocationCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** The request object for the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint. */
export type UpdateLocationRequest = {
  "location"?: Location;
};

/** The response object returned by the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint. */
export type UpdateLocationResponse = {
  "errors"?: Array<Error>;
  "location"?: Location;
};

export type UpdateLocationSettingsRequest = {
  "location_settings": CheckoutLocationSettings;
};

export type UpdateLocationSettingsResponse = {
  "errors"?: Array<Error>;
  "location_settings"?: CheckoutLocationSettings;
};

/** Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) request. */
export type UpdateMerchantCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type UpdateMerchantCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

export type UpdateMerchantSettingsRequest = {
  "merchant_settings": CheckoutMerchantSettings;
};

export type UpdateMerchantSettingsResponse = {
  "errors"?: Array<Error>;
  "merchant_settings"?: CheckoutMerchantSettings;
};

/** Represents an update request for an order custom attribute definition. */
export type UpdateOrderCustomAttributeDefinitionRequest = {
  "custom_attribute_definition": CustomAttributeDefinition;
  "idempotency_key"?: string;
};

/** Represents a response from updating an order custom attribute definition. */
export type UpdateOrderCustomAttributeDefinitionResponse = {
  "custom_attribute_definition"?: CustomAttributeDefinition;
  "errors"?: Array<Error>;
};

/** Defines the fields that are included in requests to the
[UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. */
export type UpdateOrderRequest = {
  "order"?: Order;
  "fields_to_clear"?: Array<string>;
  "idempotency_key"?: string;
};

/** Defines the fields that are included in the response body of
a request to the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. */
export type UpdateOrderResponse = {
  "order"?: Order;
  "errors"?: Array<Error>;
};

export type UpdatePaymentLinkRequest = {
  "payment_link": PaymentLink;
};

export type UpdatePaymentLinkResponse = {
  "errors"?: Array<Error>;
  "payment_link"?: PaymentLink;
};

/** Describes a request to update a payment using
[UpdatePayment](api-endpoint:Payments-UpdatePayment). */
export type UpdatePaymentRequest = {
  "payment"?: Payment;
  "idempotency_key": string;
};

/** Defines the response returned by
[UpdatePayment](api-endpoint:Payments-UpdatePayment). */
export type UpdatePaymentResponse = {
  "errors"?: Array<Error>;
  "payment"?: Payment;
};

export type UpdateScheduledShiftRequest = {
  "scheduled_shift": ScheduledShift;
};

/** Represents an [UpdateScheduledShift](api-endpoint:Labor-UpdateScheduledShift) response.
Either `scheduled_shift` or `errors` is present in the response. */
export type UpdateScheduledShiftResponse = {
  "scheduled_shift"?: ScheduledShift;
  "errors"?: Array<Error>;
};

/** A request to update a `Shift` object. */
export type UpdateShiftRequest = {
  "shift": Shift;
};

/** The response to a request to update a `Shift`. The response contains
the updated `Shift` object and might contain a set of `Error` objects if
the request resulted in errors. */
export type UpdateShiftResponse = {
  "shift"?: Shift;
  "errors"?: Array<Error>;
};

/** Defines input parameters in a request to the 
[UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) endpoint. */
export type UpdateSubscriptionRequest = {
  "subscription"?: Subscription;
};

/** Defines output parameters in a response from the
[UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) endpoint. */
export type UpdateSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: Subscription;
};

/** Represents an update request for a `TeamMember` object. */
export type UpdateTeamMemberRequest = {
  "team_member"?: TeamMember;
};

/** Represents a response from an update request containing the updated `TeamMember` object or error messages. */
export type UpdateTeamMemberResponse = {
  "team_member"?: TeamMember;
  "errors"?: Array<Error>;
};

/** A request to update a `Timecard` object. */
export type UpdateTimecardRequest = {
  "timecard": Timecard;
};

/** The response to a request to update a `Timecard`. The response contains
the updated `Timecard` object and might contain a set of `Error` objects if
the request resulted in errors. */
export type UpdateTimecardResponse = {
  "timecard"?: Timecard;
  "errors"?: Array<Error>;
};

/** Data model for updating a transfer order. All fields are optional. */
export type UpdateTransferOrderData = {
  "source_location_id"?: string;
  "destination_location_id"?: string;
  "expected_at"?: string;
  "notes"?: string;
  "tracking_number"?: string;
  "line_items"?: Array<UpdateTransferOrderLineData>;
};

/** Represents a line item update in a transfer order */
export type UpdateTransferOrderLineData = {
  "uid"?: string;
  "item_variation_id"?: string;
  "quantity_ordered"?: string;
  "remove"?: boolean;
};

/** Request to update a transfer order */
export type UpdateTransferOrderRequest = {
  "idempotency_key": string;
  "transfer_order": UpdateTransferOrderData;
  "version"?: number;
};

/** Response for updating a transfer order */
export type UpdateTransferOrderResponse = {
  "transfer_order"?: TransferOrder;
  "errors"?: Array<Error>;
};

/** Represents an input to a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor). */
export type UpdateVendorRequest = {
  "idempotency_key"?: string;
  "vendor": Vendor;
};

/** Represents an output from a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor). */
export type UpdateVendorResponse = {
  "errors"?: Array<Error>;
  "vendor"?: Vendor;
};

/** Represents an update request for the `WageSetting` object describing a `TeamMember`. */
export type UpdateWageSettingRequest = {
  "wage_setting": WageSetting;
};

/** Represents a response from an update request containing the updated `WageSetting` object
or error messages. */
export type UpdateWageSettingResponse = {
  "wage_setting"?: WageSetting;
  "errors"?: Array<Error>;
};

/** Updates a [Subscription](entity:WebhookSubscription). */
export type UpdateWebhookSubscriptionRequest = {
  "subscription"?: WebhookSubscription;
};

/** Defines the fields that are included in the response body of
a request to the [UpdateWebhookSubscription](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscription) endpoint.

Note: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not
present. */
export type UpdateWebhookSubscriptionResponse = {
  "errors"?: Array<Error>;
  "subscription"?: WebhookSubscription;
};

/** Updates a [Subscription](entity:WebhookSubscription) by replacing the existing signature key with a new one. */
export type UpdateWebhookSubscriptionSignatureKeyRequest = {
  "idempotency_key"?: string;
};

/** Defines the fields that are included in the response body of
a request to the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) endpoint.

Note: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not
present. */
export type UpdateWebhookSubscriptionSignatureKeyResponse = {
  "errors"?: Array<Error>;
  "signature_key"?: string;
};

/** A request to update a `WorkweekConfig` object. */
export type UpdateWorkweekConfigRequest = {
  "workweek_config": WorkweekConfig;
};

/** The response to a request to update a `WorkweekConfig` object. The response contains
the updated `WorkweekConfig` object and might contain a set of `Error` objects if
the request resulted in errors. */
export type UpdateWorkweekConfigResponse = {
  "workweek_config"?: WorkweekConfig;
  "errors"?: Array<Error>;
};

/** Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) request. */
export type UpsertBookingCustomAttributeRequest = {
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type UpsertBookingCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

export type UpsertCatalogObjectRequest = {
  "idempotency_key": string;
  "object": CatalogObject;
};

export type UpsertCatalogObjectResponse = {
  "errors"?: Array<Error>;
  "catalog_object"?: CatalogObject;
  "id_mappings"?: Array<CatalogIdMapping>;
};

/** Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) request. */
export type UpsertCustomerCustomAttributeRequest = {
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type UpsertCustomerCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) request. */
export type UpsertLocationCustomAttributeRequest = {
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type UpsertLocationCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) request. */
export type UpsertMerchantCustomAttributeRequest = {
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) response.
Either `custom_attribute_definition` or `errors` is present in the response. */
export type UpsertMerchantCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Represents an upsert request for an order custom attribute. */
export type UpsertOrderCustomAttributeRequest = {
  "custom_attribute": CustomAttribute;
  "idempotency_key"?: string;
};

/** Represents a response from upserting order custom attribute definitions. */
export type UpsertOrderCustomAttributeResponse = {
  "custom_attribute"?: CustomAttribute;
  "errors"?: Array<Error>;
};

/** Represents an `UpsertSnippet` request. */
export type UpsertSnippetRequest = {
  "snippet": Snippet;
};

/** Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`. */
export type UpsertSnippetResponse = {
  "errors"?: Array<Error>;
  "snippet"?: Snippet;
};

export type V1Money = {
  "amount"?: number;
  "currency_code"?: Currency;
};

/** V1Order */
export type V1Order = {
  "errors"?: Array<Error>;
  "id"?: string;
  "buyer_email"?: string;
  "recipient_name"?: string;
  "recipient_phone_number"?: string;
  "state"?: V1OrderState;
  "shipping_address"?: Address;
  "subtotal_money"?: V1Money;
  "total_shipping_money"?: V1Money;
  "total_tax_money"?: V1Money;
  "total_price_money"?: V1Money;
  "total_discount_money"?: V1Money;
  "created_at"?: string;
  "updated_at"?: string;
  "expires_at"?: string;
  "payment_id"?: string;
  "buyer_note"?: string;
  "completed_note"?: string;
  "refunded_note"?: string;
  "canceled_note"?: string;
  "tender"?: V1Tender;
  "order_history"?: Array<V1OrderHistoryEntry>;
  "promo_code"?: string;
  "btc_receive_address"?: string;
  "btc_price_satoshi"?: number;
};

/** V1OrderHistoryEntry */
export type V1OrderHistoryEntry = {
  "action"?: V1OrderHistoryEntryAction;
  "created_at"?: string;
};

export type V1OrderHistoryEntryAction = "ORDER_PLACED" | "DECLINED" | "PAYMENT_RECEIVED" | "CANCELED" | "COMPLETED" | "REFUNDED" | "EXPIRED";

export type V1OrderState = "PENDING" | "OPEN" | "COMPLETED" | "CANCELED" | "REFUNDED" | "REJECTED";

/** A tender represents a discrete monetary exchange. Square represents this
exchange as a money object with a specific currency and amount, where the
amount is given in the smallest denomination of the given currency.

Square POS can accept more than one form of tender for a single payment (such
as by splitting a bill between a credit card and a gift card). The `tender`
field of the Payment object lists all forms of tender used for the payment.

Split tender payments behave slightly differently from single tender payments:

The receipt_url for a split tender corresponds only to the first tender listed
in the tender field. To get the receipt URLs for the remaining tenders, use
the receipt_url fields of the corresponding Tender objects.

*A note on gift cards**: when a customer purchases a Square gift card from a
merchant, the merchant receives the full amount of the gift card in the
associated payment.

When that gift card is used as a tender, the balance of the gift card is
reduced and the merchant receives no funds. A `Tender` object with a type of
`SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the
associated payment. */
export type V1Tender = {
  "id"?: string;
  "type"?: V1TenderType;
  "name"?: string;
  "employee_id"?: string;
  "receipt_url"?: string;
  "card_brand"?: V1TenderCardBrand;
  "pan_suffix"?: string;
  "entry_method"?: V1TenderEntryMethod;
  "payment_note"?: string;
  "total_money"?: V1Money;
  "tendered_money"?: V1Money;
  "tendered_at"?: string;
  "settled_at"?: string;
  "change_back_money"?: V1Money;
  "refunded_money"?: V1Money;
  "is_exchange"?: boolean;
};

/** The brand of a credit card. */
export type V1TenderCardBrand = "OTHER_BRAND" | "VISA" | "MASTER_CARD" | "AMERICAN_EXPRESS" | "DISCOVER" | "DISCOVER_DINERS" | "JCB" | "CHINA_UNIONPAY" | "SQUARE_GIFT_CARD";

export type V1TenderEntryMethod = "MANUAL" | "SCANNED" | "SQUARE_CASH" | "SQUARE_WALLET" | "SWIPED" | "WEB_FORM" | "OTHER";

export type V1TenderType = "CREDIT_CARD" | "CASH" | "THIRD_PARTY_CARD" | "NO_SALE" | "SQUARE_WALLET" | "SQUARE_GIFT_CARD" | "UNKNOWN" | "OTHER";

/** V1UpdateOrderRequest */
export type V1UpdateOrderRequest = {
  "action": V1UpdateOrderRequestAction;
  "shipped_tracking_number"?: string;
  "completed_note"?: string;
  "refunded_note"?: string;
  "canceled_note"?: string;
};

export type V1UpdateOrderRequestAction = "COMPLETE" | "CANCEL" | "REFUND";

/** Represents a supplier to a seller. */
export type Vendor = {
  "id"?: string;
  "created_at"?: string;
  "updated_at"?: string;
  "name"?: string;
  "address"?: Address;
  "contacts"?: Array<VendorContact>;
  "account_number"?: string;
  "note"?: string;
  "version"?: number;
  "status"?: VendorStatus;
};

/** Represents a contact of a [Vendor](entity:Vendor). */
export type VendorContact = {
  "id"?: string;
  "name"?: string;
  "email_address"?: string;
  "phone_number"?: string;
  "removed"?: boolean;
  "ordinal": number;
};

/** Published when a [Vendor](entity:Vendor) is created. */
export type VendorCreatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: VendorCreatedEventData;
};

/** Defines the `vendor.created` event data structure. */
export type VendorCreatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: VendorCreatedEventObject;
};

export type VendorCreatedEventObject = {
  "operation"?: VendorCreatedEventObjectOperation;
  "vendor"?: Vendor;
};

/** The operation that can be performed against a vendor to cause the event to be published. */
export type VendorCreatedEventObjectOperation = "CREATED";

/** The status of the [Vendor](entity:Vendor),
whether a [Vendor](entity:Vendor) is active or inactive. */
export type VendorStatus = "ACTIVE" | "INACTIVE";

/** Published when a [Vendor](entity:Vendor) is updated. */
export type VendorUpdatedEvent = {
  "merchant_id"?: string;
  "location_id"?: string;
  "type"?: string;
  "event_id"?: string;
  "created_at"?: string;
  "data"?: VendorUpdatedEventData;
};

/** Defines the `vendor.updated` event data structure. */
export type VendorUpdatedEventData = {
  "type"?: string;
  "id"?: string;
  "object"?: VendorUpdatedEventObject;
};

export type VendorUpdatedEventObject = {
  "operation"?: VendorUpdatedEventObjectOperation;
  "vendor"?: Vendor;
};

/** The operation that can be performed against a vendor to cause the event to be published. */
export type VendorUpdatedEventObjectOperation = "UPDATED";

/** Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. */
export type VisibilityFilter = "ALL" | "READ" | "READ_WRITE";

/** Defines the fields that are included in the response body of
a request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. */
export type VoidTransactionResponse = {
  "errors"?: Array<Error>;
};

/** Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](entity:TeamMember). */
export type WageSetting = {
  "team_member_id"?: string;
  "job_assignments"?: Array<JobAssignment>;
  "is_overtime_exempt"?: boolean;
  "version"?: number;
  "created_at"?: string;
  "updated_at"?: string;
};

/** Represents the details of a webhook subscription, including notification URL,
event types, and signature key. */
export type WebhookSubscription = {
  "id"?: string;
  "name"?: string;
  "enabled"?: boolean;
  "event_types"?: Array<string>;
  "notification_url"?: string;
  "api_version"?: string;
  "signature_key"?: string;
  "created_at"?: string;
  "updated_at"?: string;
};

/** The days of the week. */
export type Weekday = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN";

/** Sets the day of the week and hour of the day that a business starts a
workweek. This is used to calculate overtime pay. */
export type WorkweekConfig = {
  "id"?: string;
  "start_of_week": Weekday;
  "start_of_day_local_time": string;
  "version"?: number;
  "created_at"?: string;
  "updated_at"?: string;
};

export type RevokeTokenBody = RevokeTokenRequest;

export type RevokeTokenResponse = RevokeTokenResponse;

export type ObtainTokenBody = ObtainTokenRequest;

export type ObtainTokenResponse = ObtainTokenResponse;

export type RetrieveTokenStatusResponse = RetrieveTokenStatusResponse;

export type V1ListOrdersResponse = Array<V1Order>;

export type V1RetrieveOrderResponse = V1Order;

export type V1UpdateOrderBody = V1UpdateOrderRequest;

export type V1UpdateOrderResponse = V1Order;

export type RegisterDomainBody = RegisterDomainRequest;

export type RegisterDomainResponse = RegisterDomainResponse;

export type ListBankAccountsResponse = ListBankAccountsResponse;

export type CreateBankAccountBody = CreateBankAccountRequest;

export type CreateBankAccountResponse = CreateBankAccountResponse;

export type GetBankAccountByV1IdResponse = GetBankAccountByV1IdResponse;

export type GetBankAccountResponse = GetBankAccountResponse;

export type DisableBankAccountResponse = DisableBankAccountResponse;

export type ListBookingsResponse = ListBookingsResponse;

export type CreateBookingBody = CreateBookingRequest;

export type CreateBookingResponse = CreateBookingResponse;

export type SearchAvailabilityBody = SearchAvailabilityRequest;

export type SearchAvailabilityResponse = SearchAvailabilityResponse;

export type BulkRetrieveBookingsBody = BulkRetrieveBookingsRequest;

export type BulkRetrieveBookingsResponse = BulkRetrieveBookingsResponse;

export type RetrieveBusinessBookingProfileResponse = RetrieveBusinessBookingProfileResponse;

export type ListBookingCustomAttributeDefinitionsResponse = ListBookingCustomAttributeDefinitionsResponse;

export type CreateBookingCustomAttributeDefinitionBody = CreateBookingCustomAttributeDefinitionRequest;

export type CreateBookingCustomAttributeDefinitionResponse = CreateBookingCustomAttributeDefinitionResponse;

export type RetrieveBookingCustomAttributeDefinitionResponse = RetrieveBookingCustomAttributeDefinitionResponse;

export type UpdateBookingCustomAttributeDefinitionBody = UpdateBookingCustomAttributeDefinitionRequest;

export type UpdateBookingCustomAttributeDefinitionResponse = UpdateBookingCustomAttributeDefinitionResponse;

export type DeleteBookingCustomAttributeDefinitionResponse = DeleteBookingCustomAttributeDefinitionResponse;

export type BulkDeleteBookingCustomAttributesBody = BulkDeleteBookingCustomAttributesRequest;

export type BulkDeleteBookingCustomAttributesResponse = BulkDeleteBookingCustomAttributesResponse;

export type BulkUpsertBookingCustomAttributesBody = BulkUpsertBookingCustomAttributesRequest;

export type BulkUpsertBookingCustomAttributesResponse = BulkUpsertBookingCustomAttributesResponse;

export type ListLocationBookingProfilesResponse = ListLocationBookingProfilesResponse;

export type RetrieveLocationBookingProfileResponse = RetrieveLocationBookingProfileResponse;

export type ListTeamMemberBookingProfilesResponse = ListTeamMemberBookingProfilesResponse;

export type BulkRetrieveTeamMemberBookingProfilesBody = BulkRetrieveTeamMemberBookingProfilesRequest;

export type BulkRetrieveTeamMemberBookingProfilesResponse = BulkRetrieveTeamMemberBookingProfilesResponse;

export type RetrieveTeamMemberBookingProfileResponse = RetrieveTeamMemberBookingProfileResponse;

export type RetrieveBookingResponse = RetrieveBookingResponse;

export type UpdateBookingBody = UpdateBookingRequest;

export type UpdateBookingResponse = UpdateBookingResponse;

export type CancelBookingBody = CancelBookingRequest;

export type CancelBookingResponse = CancelBookingResponse;

export type ListBookingCustomAttributesResponse = ListBookingCustomAttributesResponse;

export type RetrieveBookingCustomAttributeResponse = RetrieveBookingCustomAttributeResponse;

export type UpsertBookingCustomAttributeBody = UpsertBookingCustomAttributeRequest;

export type UpsertBookingCustomAttributeResponse = UpsertBookingCustomAttributeResponse;

export type DeleteBookingCustomAttributeResponse = DeleteBookingCustomAttributeResponse;

export type ListCardsResponse = ListCardsResponse;

export type CreateCardBody = CreateCardRequest;

export type CreateCardResponse = CreateCardResponse;

export type RetrieveCardResponse = RetrieveCardResponse;

export type DisableCardResponse = DisableCardResponse;

export type ListCashDrawerShiftsResponse = ListCashDrawerShiftsResponse;

export type RetrieveCashDrawerShiftResponse = RetrieveCashDrawerShiftResponse;

export type ListCashDrawerShiftEventsResponse = ListCashDrawerShiftEventsResponse;

export type BatchDeleteCatalogObjectsBody = BatchDeleteCatalogObjectsRequest;

export type BatchDeleteCatalogObjectsResponse = BatchDeleteCatalogObjectsResponse;

export type BatchRetrieveCatalogObjectsBody = BatchRetrieveCatalogObjectsRequest;

export type BatchRetrieveCatalogObjectsResponse = BatchRetrieveCatalogObjectsResponse;

export type BatchUpsertCatalogObjectsBody = BatchUpsertCatalogObjectsRequest;

export type BatchUpsertCatalogObjectsResponse = BatchUpsertCatalogObjectsResponse;

export type CreateCatalogImageBody = {
  "request"?: CreateCatalogImageRequest;
  "image_file"?: string;
};

export type CreateCatalogImageResponse = CreateCatalogImageResponse;

export type UpdateCatalogImageBody = {
  "request"?: UpdateCatalogImageRequest;
  "image_file"?: string;
};

export type UpdateCatalogImageResponse = UpdateCatalogImageResponse;

export type CatalogInfoResponse = CatalogInfoResponse;

export type ListCatalogResponse = ListCatalogResponse;

export type UpsertCatalogObjectBody = UpsertCatalogObjectRequest;

export type UpsertCatalogObjectResponse = UpsertCatalogObjectResponse;

export type RetrieveCatalogObjectResponse = RetrieveCatalogObjectResponse;

export type DeleteCatalogObjectResponse = DeleteCatalogObjectResponse;

export type SearchCatalogObjectsBody = SearchCatalogObjectsRequest;

export type SearchCatalogObjectsResponse = SearchCatalogObjectsResponse;

export type SearchCatalogItemsBody = SearchCatalogItemsRequest;

export type SearchCatalogItemsResponse = SearchCatalogItemsResponse;

export type UpdateItemModifierListsBody = UpdateItemModifierListsRequest;

export type UpdateItemModifierListsResponse = UpdateItemModifierListsResponse;

export type UpdateItemTaxesBody = UpdateItemTaxesRequest;

export type UpdateItemTaxesResponse = UpdateItemTaxesResponse;

export type ListChannelsResponse = ListChannelsResponse;

export type BulkRetrieveChannelsBody = BulkRetrieveChannelsRequest;

export type BulkRetrieveChannelsResponse = BulkRetrieveChannelsResponse;

export type RetrieveChannelResponse = RetrieveChannelResponse;

export type ListCustomersResponse = ListCustomersResponse;

export type CreateCustomerBody = CreateCustomerRequest;

export type CreateCustomerResponse = CreateCustomerResponse;

export type BulkCreateCustomersBody = BulkCreateCustomersRequest;

export type BulkCreateCustomersResponse = BulkCreateCustomersResponse;

export type BulkDeleteCustomersBody = BulkDeleteCustomersRequest;

export type BulkDeleteCustomersResponse = BulkDeleteCustomersResponse;

export type BulkRetrieveCustomersBody = BulkRetrieveCustomersRequest;

export type BulkRetrieveCustomersResponse = BulkRetrieveCustomersResponse;

export type BulkUpdateCustomersBody = BulkUpdateCustomersRequest;

export type BulkUpdateCustomersResponse = BulkUpdateCustomersResponse;

export type ListCustomerCustomAttributeDefinitionsResponse = ListCustomerCustomAttributeDefinitionsResponse;

export type CreateCustomerCustomAttributeDefinitionBody = CreateCustomerCustomAttributeDefinitionRequest;

export type CreateCustomerCustomAttributeDefinitionResponse = CreateCustomerCustomAttributeDefinitionResponse;

export type RetrieveCustomerCustomAttributeDefinitionResponse = RetrieveCustomerCustomAttributeDefinitionResponse;

export type UpdateCustomerCustomAttributeDefinitionBody = UpdateCustomerCustomAttributeDefinitionRequest;

export type UpdateCustomerCustomAttributeDefinitionResponse = UpdateCustomerCustomAttributeDefinitionResponse;

export type DeleteCustomerCustomAttributeDefinitionResponse = DeleteCustomerCustomAttributeDefinitionResponse;

export type BulkUpsertCustomerCustomAttributesBody = BulkUpsertCustomerCustomAttributesRequest;

export type BulkUpsertCustomerCustomAttributesResponse = BulkUpsertCustomerCustomAttributesResponse;

export type ListCustomerGroupsResponse = ListCustomerGroupsResponse;

export type CreateCustomerGroupBody = CreateCustomerGroupRequest;

export type CreateCustomerGroupResponse = CreateCustomerGroupResponse;

export type RetrieveCustomerGroupResponse = RetrieveCustomerGroupResponse;

export type UpdateCustomerGroupBody = UpdateCustomerGroupRequest;

export type UpdateCustomerGroupResponse = UpdateCustomerGroupResponse;

export type DeleteCustomerGroupResponse = DeleteCustomerGroupResponse;

export type SearchCustomersBody = SearchCustomersRequest;

export type SearchCustomersResponse = SearchCustomersResponse;

export type ListCustomerSegmentsResponse = ListCustomerSegmentsResponse;

export type RetrieveCustomerSegmentResponse = RetrieveCustomerSegmentResponse;

export type RetrieveCustomerResponse = RetrieveCustomerResponse;

export type UpdateCustomerBody = UpdateCustomerRequest;

export type UpdateCustomerResponse = UpdateCustomerResponse;

export type DeleteCustomerResponse = DeleteCustomerResponse;

export type CreateCustomerCardBody = CreateCustomerCardRequest;

export type CreateCustomerCardResponse = CreateCustomerCardResponse;

export type DeleteCustomerCardResponse = DeleteCustomerCardResponse;

export type ListCustomerCustomAttributesResponse = ListCustomerCustomAttributesResponse;

export type RetrieveCustomerCustomAttributeResponse = RetrieveCustomerCustomAttributeResponse;

export type UpsertCustomerCustomAttributeBody = UpsertCustomerCustomAttributeRequest;

export type UpsertCustomerCustomAttributeResponse = UpsertCustomerCustomAttributeResponse;

export type DeleteCustomerCustomAttributeResponse = DeleteCustomerCustomAttributeResponse;

export type AddGroupToCustomerResponse = AddGroupToCustomerResponse;

export type RemoveGroupFromCustomerResponse = RemoveGroupFromCustomerResponse;

export type ListDevicesResponse = ListDevicesResponse;

export type ListDeviceCodesResponse = ListDeviceCodesResponse;

export type CreateDeviceCodeBody = CreateDeviceCodeRequest;

export type CreateDeviceCodeResponse = CreateDeviceCodeResponse;

export type GetDeviceCodeResponse = GetDeviceCodeResponse;

export type GetDeviceResponse = GetDeviceResponse;

export type ListDisputesResponse = ListDisputesResponse;

export type RetrieveDisputeResponse = RetrieveDisputeResponse;

export type AcceptDisputeResponse = AcceptDisputeResponse;

export type ListDisputeEvidenceResponse = ListDisputeEvidenceResponse;

export type CreateDisputeEvidenceFileBody = {
  "request"?: CreateDisputeEvidenceFileRequest;
  "image_file"?: string;
};

export type CreateDisputeEvidenceFileResponse = CreateDisputeEvidenceFileResponse;

export type CreateDisputeEvidenceTextBody = CreateDisputeEvidenceTextRequest;

export type CreateDisputeEvidenceTextResponse = CreateDisputeEvidenceTextResponse;

export type RetrieveDisputeEvidenceResponse = RetrieveDisputeEvidenceResponse;

export type DeleteDisputeEvidenceResponse = DeleteDisputeEvidenceResponse;

export type SubmitEvidenceResponse = SubmitEvidenceResponse;

export type ListEmployeesResponse = ListEmployeesResponse;

export type RetrieveEmployeeResponse = RetrieveEmployeeResponse;

export type SearchEventsBody = SearchEventsRequest;

export type SearchEventsResponse = SearchEventsResponse;

export type DisableEventsResponse = DisableEventsResponse;

export type EnableEventsResponse = EnableEventsResponse;

export type ListEventTypesResponse = ListEventTypesResponse;

export type ListGiftCardsResponse = ListGiftCardsResponse;

export type CreateGiftCardBody = CreateGiftCardRequest;

export type CreateGiftCardResponse = CreateGiftCardResponse;

export type ListGiftCardActivitiesResponse = ListGiftCardActivitiesResponse;

export type CreateGiftCardActivityBody = CreateGiftCardActivityRequest;

export type CreateGiftCardActivityResponse = CreateGiftCardActivityResponse;

export type RetrieveGiftCardFromGANBody = RetrieveGiftCardFromGANRequest;

export type RetrieveGiftCardFromGANResponse = RetrieveGiftCardFromGANResponse;

export type RetrieveGiftCardFromNonceBody = RetrieveGiftCardFromNonceRequest;

export type RetrieveGiftCardFromNonceResponse = RetrieveGiftCardFromNonceResponse;

export type LinkCustomerToGiftCardBody = LinkCustomerToGiftCardRequest;

export type LinkCustomerToGiftCardResponse = LinkCustomerToGiftCardResponse;

export type UnlinkCustomerFromGiftCardBody = UnlinkCustomerFromGiftCardRequest;

export type UnlinkCustomerFromGiftCardResponse = UnlinkCustomerFromGiftCardResponse;

export type RetrieveGiftCardResponse = RetrieveGiftCardResponse;

export type DeprecatedRetrieveInventoryAdjustmentResponse = RetrieveInventoryAdjustmentResponse;

export type RetrieveInventoryAdjustmentResponse = RetrieveInventoryAdjustmentResponse;

export type DeprecatedBatchChangeInventoryBody = BatchChangeInventoryRequest;

export type DeprecatedBatchChangeInventoryResponse = BatchChangeInventoryResponse;

export type DeprecatedBatchRetrieveInventoryChangesBody = BatchRetrieveInventoryChangesRequest;

export type DeprecatedBatchRetrieveInventoryChangesResponse = BatchRetrieveInventoryChangesResponse;

export type DeprecatedBatchRetrieveInventoryCountsBody = BatchRetrieveInventoryCountsRequest;

export type DeprecatedBatchRetrieveInventoryCountsResponse = BatchRetrieveInventoryCountsResponse;

export type BatchChangeInventoryBody = BatchChangeInventoryRequest;

export type BatchChangeInventoryResponse = BatchChangeInventoryResponse;

export type BatchRetrieveInventoryChangesBody = BatchRetrieveInventoryChangesRequest;

export type BatchRetrieveInventoryChangesResponse = BatchRetrieveInventoryChangesResponse;

export type BatchRetrieveInventoryCountsBody = BatchRetrieveInventoryCountsRequest;

export type BatchRetrieveInventoryCountsResponse = BatchRetrieveInventoryCountsResponse;

export type DeprecatedRetrieveInventoryPhysicalCountResponse = RetrieveInventoryPhysicalCountResponse;

export type RetrieveInventoryPhysicalCountResponse = RetrieveInventoryPhysicalCountResponse;

export type RetrieveInventoryTransferResponse = RetrieveInventoryTransferResponse;

export type RetrieveInventoryCountResponse = RetrieveInventoryCountResponse;

export type RetrieveInventoryChangesResponse = RetrieveInventoryChangesResponse;

export type ListInvoicesResponse = ListInvoicesResponse;

export type CreateInvoiceBody = CreateInvoiceRequest;

export type CreateInvoiceResponse = CreateInvoiceResponse;

export type SearchInvoicesBody = SearchInvoicesRequest;

export type SearchInvoicesResponse = SearchInvoicesResponse;

export type GetInvoiceResponse = GetInvoiceResponse;

export type UpdateInvoiceBody = UpdateInvoiceRequest;

export type UpdateInvoiceResponse = UpdateInvoiceResponse;

export type DeleteInvoiceResponse = DeleteInvoiceResponse;

export type CreateInvoiceAttachmentBody = {
  "request"?: CreateInvoiceAttachmentRequest;
  "image_file"?: string;
};

export type CreateInvoiceAttachmentResponse = CreateInvoiceAttachmentResponse;

export type DeleteInvoiceAttachmentResponse = DeleteInvoiceAttachmentResponse;

export type CancelInvoiceBody = CancelInvoiceRequest;

export type CancelInvoiceResponse = CancelInvoiceResponse;

export type PublishInvoiceBody = PublishInvoiceRequest;

export type PublishInvoiceResponse = PublishInvoiceResponse;

export type ListBreakTypesResponse = ListBreakTypesResponse;

export type CreateBreakTypeBody = CreateBreakTypeRequest;

export type CreateBreakTypeResponse = CreateBreakTypeResponse;

export type GetBreakTypeResponse = GetBreakTypeResponse;

export type UpdateBreakTypeBody = UpdateBreakTypeRequest;

export type UpdateBreakTypeResponse = UpdateBreakTypeResponse;

export type DeleteBreakTypeResponse = DeleteBreakTypeResponse;

export type ListEmployeeWagesResponse = ListEmployeeWagesResponse;

export type GetEmployeeWageResponse = GetEmployeeWageResponse;

export type CreateScheduledShiftBody = CreateScheduledShiftRequest;

export type CreateScheduledShiftResponse = CreateScheduledShiftResponse;

export type BulkPublishScheduledShiftsBody = BulkPublishScheduledShiftsRequest;

export type BulkPublishScheduledShiftsResponse = BulkPublishScheduledShiftsResponse;

export type SearchScheduledShiftsBody = SearchScheduledShiftsRequest;

export type SearchScheduledShiftsResponse = SearchScheduledShiftsResponse;

export type RetrieveScheduledShiftResponse = RetrieveScheduledShiftResponse;

export type UpdateScheduledShiftBody = UpdateScheduledShiftRequest;

export type UpdateScheduledShiftResponse = UpdateScheduledShiftResponse;

export type PublishScheduledShiftBody = PublishScheduledShiftRequest;

export type PublishScheduledShiftResponse = PublishScheduledShiftResponse;

export type CreateShiftBody = CreateShiftRequest;

export type CreateShiftResponse = CreateShiftResponse;

export type SearchShiftsBody = SearchShiftsRequest;

export type SearchShiftsResponse = SearchShiftsResponse;

export type GetShiftResponse = GetShiftResponse;

export type UpdateShiftBody = UpdateShiftRequest;

export type UpdateShiftResponse = UpdateShiftResponse;

export type DeleteShiftResponse = DeleteShiftResponse;

export type ListTeamMemberWagesResponse = ListTeamMemberWagesResponse;

export type GetTeamMemberWageResponse = GetTeamMemberWageResponse;

export type CreateTimecardBody = CreateTimecardRequest;

export type CreateTimecardResponse = CreateTimecardResponse;

export type SearchTimecardsBody = SearchTimecardsRequest;

export type SearchTimecardsResponse = SearchTimecardsResponse;

export type RetrieveTimecardResponse = RetrieveTimecardResponse;

export type UpdateTimecardBody = UpdateTimecardRequest;

export type UpdateTimecardResponse = UpdateTimecardResponse;

export type DeleteTimecardResponse = DeleteTimecardResponse;

export type ListWorkweekConfigsResponse = ListWorkweekConfigsResponse;

export type UpdateWorkweekConfigBody = UpdateWorkweekConfigRequest;

export type UpdateWorkweekConfigResponse = UpdateWorkweekConfigResponse;

export type ListLocationsResponse = ListLocationsResponse;

export type CreateLocationBody = CreateLocationRequest;

export type CreateLocationResponse = CreateLocationResponse;

export type ListLocationCustomAttributeDefinitionsResponse = ListLocationCustomAttributeDefinitionsResponse;

export type CreateLocationCustomAttributeDefinitionBody = CreateLocationCustomAttributeDefinitionRequest;

export type CreateLocationCustomAttributeDefinitionResponse = CreateLocationCustomAttributeDefinitionResponse;

export type RetrieveLocationCustomAttributeDefinitionResponse = RetrieveLocationCustomAttributeDefinitionResponse;

export type UpdateLocationCustomAttributeDefinitionBody = UpdateLocationCustomAttributeDefinitionRequest;

export type UpdateLocationCustomAttributeDefinitionResponse = UpdateLocationCustomAttributeDefinitionResponse;

export type DeleteLocationCustomAttributeDefinitionResponse = DeleteLocationCustomAttributeDefinitionResponse;

export type BulkDeleteLocationCustomAttributesBody = BulkDeleteLocationCustomAttributesRequest;

export type BulkDeleteLocationCustomAttributesResponse = BulkDeleteLocationCustomAttributesResponse;

export type BulkUpsertLocationCustomAttributesBody = BulkUpsertLocationCustomAttributesRequest;

export type BulkUpsertLocationCustomAttributesResponse = BulkUpsertLocationCustomAttributesResponse;

export type RetrieveLocationResponse = RetrieveLocationResponse;

export type UpdateLocationBody = UpdateLocationRequest;

export type UpdateLocationResponse = UpdateLocationResponse;

export type CreateCheckoutBody = CreateCheckoutRequest;

export type CreateCheckoutResponse = CreateCheckoutResponse;

export type ListLocationCustomAttributesResponse = ListLocationCustomAttributesResponse;

export type RetrieveLocationCustomAttributeResponse = RetrieveLocationCustomAttributeResponse;

export type UpsertLocationCustomAttributeBody = UpsertLocationCustomAttributeRequest;

export type UpsertLocationCustomAttributeResponse = UpsertLocationCustomAttributeResponse;

export type DeleteLocationCustomAttributeResponse = DeleteLocationCustomAttributeResponse;

export type ListTransactionsResponse = ListTransactionsResponse;

export type RetrieveTransactionResponse = RetrieveTransactionResponse;

export type CaptureTransactionResponse = CaptureTransactionResponse;

export type VoidTransactionResponse = VoidTransactionResponse;

export type CreateLoyaltyAccountBody = CreateLoyaltyAccountRequest;

export type CreateLoyaltyAccountResponse = CreateLoyaltyAccountResponse;

export type SearchLoyaltyAccountsBody = SearchLoyaltyAccountsRequest;

export type SearchLoyaltyAccountsResponse = SearchLoyaltyAccountsResponse;

export type RetrieveLoyaltyAccountResponse = RetrieveLoyaltyAccountResponse;

export type AccumulateLoyaltyPointsBody = AccumulateLoyaltyPointsRequest;

export type AccumulateLoyaltyPointsResponse = AccumulateLoyaltyPointsResponse;

export type AdjustLoyaltyPointsBody = AdjustLoyaltyPointsRequest;

export type AdjustLoyaltyPointsResponse = AdjustLoyaltyPointsResponse;

export type SearchLoyaltyEventsBody = SearchLoyaltyEventsRequest;

export type SearchLoyaltyEventsResponse = SearchLoyaltyEventsResponse;

export type ListLoyaltyProgramsResponse = ListLoyaltyProgramsResponse;

export type RetrieveLoyaltyProgramResponse = RetrieveLoyaltyProgramResponse;

export type CalculateLoyaltyPointsBody = CalculateLoyaltyPointsRequest;

export type CalculateLoyaltyPointsResponse = CalculateLoyaltyPointsResponse;

export type ListLoyaltyPromotionsResponse = ListLoyaltyPromotionsResponse;

export type CreateLoyaltyPromotionBody = CreateLoyaltyPromotionRequest;

export type CreateLoyaltyPromotionResponse = CreateLoyaltyPromotionResponse;

export type RetrieveLoyaltyPromotionResponse = RetrieveLoyaltyPromotionResponse;

export type CancelLoyaltyPromotionResponse = CancelLoyaltyPromotionResponse;

export type CreateLoyaltyRewardBody = CreateLoyaltyRewardRequest;

export type CreateLoyaltyRewardResponse = CreateLoyaltyRewardResponse;

export type SearchLoyaltyRewardsBody = SearchLoyaltyRewardsRequest;

export type SearchLoyaltyRewardsResponse = SearchLoyaltyRewardsResponse;

export type RetrieveLoyaltyRewardResponse = RetrieveLoyaltyRewardResponse;

export type DeleteLoyaltyRewardResponse = DeleteLoyaltyRewardResponse;

export type RedeemLoyaltyRewardBody = RedeemLoyaltyRewardRequest;

export type RedeemLoyaltyRewardResponse = RedeemLoyaltyRewardResponse;

export type ListMerchantsResponse = ListMerchantsResponse;

export type ListMerchantCustomAttributeDefinitionsResponse = ListMerchantCustomAttributeDefinitionsResponse;

export type CreateMerchantCustomAttributeDefinitionBody = CreateMerchantCustomAttributeDefinitionRequest;

export type CreateMerchantCustomAttributeDefinitionResponse = CreateMerchantCustomAttributeDefinitionResponse;

export type RetrieveMerchantCustomAttributeDefinitionResponse = RetrieveMerchantCustomAttributeDefinitionResponse;

export type UpdateMerchantCustomAttributeDefinitionBody = UpdateMerchantCustomAttributeDefinitionRequest;

export type UpdateMerchantCustomAttributeDefinitionResponse = UpdateMerchantCustomAttributeDefinitionResponse;

export type DeleteMerchantCustomAttributeDefinitionResponse = DeleteMerchantCustomAttributeDefinitionResponse;

export type BulkDeleteMerchantCustomAttributesBody = BulkDeleteMerchantCustomAttributesRequest;

export type BulkDeleteMerchantCustomAttributesResponse = BulkDeleteMerchantCustomAttributesResponse;

export type BulkUpsertMerchantCustomAttributesBody = BulkUpsertMerchantCustomAttributesRequest;

export type BulkUpsertMerchantCustomAttributesResponse = BulkUpsertMerchantCustomAttributesResponse;

export type RetrieveMerchantResponse = RetrieveMerchantResponse;

export type ListMerchantCustomAttributesResponse = ListMerchantCustomAttributesResponse;

export type RetrieveMerchantCustomAttributeResponse = RetrieveMerchantCustomAttributeResponse;

export type UpsertMerchantCustomAttributeBody = UpsertMerchantCustomAttributeRequest;

export type UpsertMerchantCustomAttributeResponse = UpsertMerchantCustomAttributeResponse;

export type DeleteMerchantCustomAttributeResponse = DeleteMerchantCustomAttributeResponse;

export type RetrieveLocationSettingsResponse = RetrieveLocationSettingsResponse;

export type UpdateLocationSettingsBody = UpdateLocationSettingsRequest;

export type UpdateLocationSettingsResponse = UpdateLocationSettingsResponse;

export type RetrieveMerchantSettingsResponse = RetrieveMerchantSettingsResponse;

export type UpdateMerchantSettingsBody = UpdateMerchantSettingsRequest;

export type UpdateMerchantSettingsResponse = UpdateMerchantSettingsResponse;

export type ListPaymentLinksResponse = ListPaymentLinksResponse;

export type CreatePaymentLinkBody = CreatePaymentLinkRequest;

export type CreatePaymentLinkResponse = CreatePaymentLinkResponse;

export type RetrievePaymentLinkResponse = RetrievePaymentLinkResponse;

export type UpdatePaymentLinkBody = UpdatePaymentLinkRequest;

export type UpdatePaymentLinkResponse = UpdatePaymentLinkResponse;

export type DeletePaymentLinkResponse = DeletePaymentLinkResponse;

export type CreateOrderBody = CreateOrderRequest;

export type CreateOrderResponse = CreateOrderResponse;

export type BatchRetrieveOrdersBody = BatchRetrieveOrdersRequest;

export type BatchRetrieveOrdersResponse = BatchRetrieveOrdersResponse;

export type CalculateOrderBody = CalculateOrderRequest;

export type CalculateOrderResponse = CalculateOrderResponse;

export type CloneOrderBody = CloneOrderRequest;

export type CloneOrderResponse = CloneOrderResponse;

export type ListOrderCustomAttributeDefinitionsResponse = ListOrderCustomAttributeDefinitionsResponse;

export type CreateOrderCustomAttributeDefinitionBody = CreateOrderCustomAttributeDefinitionRequest;

export type CreateOrderCustomAttributeDefinitionResponse = CreateOrderCustomAttributeDefinitionResponse;

export type RetrieveOrderCustomAttributeDefinitionResponse = RetrieveOrderCustomAttributeDefinitionResponse;

export type UpdateOrderCustomAttributeDefinitionBody = UpdateOrderCustomAttributeDefinitionRequest;

export type UpdateOrderCustomAttributeDefinitionResponse = UpdateOrderCustomAttributeDefinitionResponse;

export type DeleteOrderCustomAttributeDefinitionResponse = DeleteOrderCustomAttributeDefinitionResponse;

export type BulkDeleteOrderCustomAttributesBody = BulkDeleteOrderCustomAttributesRequest;

export type BulkDeleteOrderCustomAttributesResponse = BulkDeleteOrderCustomAttributesResponse;

export type BulkUpsertOrderCustomAttributesBody = BulkUpsertOrderCustomAttributesRequest;

export type BulkUpsertOrderCustomAttributesResponse = BulkUpsertOrderCustomAttributesResponse;

export type SearchOrdersBody = SearchOrdersRequest;

export type SearchOrdersResponse = SearchOrdersResponse;

export type RetrieveOrderResponse = RetrieveOrderResponse;

export type UpdateOrderBody = UpdateOrderRequest;

export type UpdateOrderResponse = UpdateOrderResponse;

export type ListOrderCustomAttributesResponse = ListOrderCustomAttributesResponse;

export type RetrieveOrderCustomAttributeResponse = RetrieveOrderCustomAttributeResponse;

export type UpsertOrderCustomAttributeBody = UpsertOrderCustomAttributeRequest;

export type UpsertOrderCustomAttributeResponse = UpsertOrderCustomAttributeResponse;

export type DeleteOrderCustomAttributeResponse = DeleteOrderCustomAttributeResponse;

export type PayOrderBody = PayOrderRequest;

export type PayOrderResponse = PayOrderResponse;

export type ListPaymentsResponse = ListPaymentsResponse;

export type CreatePaymentBody = CreatePaymentRequest;

export type CreatePaymentResponse = CreatePaymentResponse;

export type CancelPaymentByIdempotencyKeyBody = CancelPaymentByIdempotencyKeyRequest;

export type CancelPaymentByIdempotencyKeyResponse = CancelPaymentByIdempotencyKeyResponse;

export type GetPaymentResponse = GetPaymentResponse;

export type UpdatePaymentBody = UpdatePaymentRequest;

export type UpdatePaymentResponse = UpdatePaymentResponse;

export type CancelPaymentResponse = CancelPaymentResponse;

export type CompletePaymentBody = CompletePaymentRequest;

export type CompletePaymentResponse = CompletePaymentResponse;

export type ListPayoutsResponse = ListPayoutsResponse;

export type GetPayoutResponse = GetPayoutResponse;

export type ListPayoutEntriesResponse = ListPayoutEntriesResponse;

export type ListPaymentRefundsResponse = ListPaymentRefundsResponse;

export type RefundPaymentBody = RefundPaymentRequest;

export type RefundPaymentResponse = RefundPaymentResponse;

export type GetPaymentRefundResponse = GetPaymentRefundResponse;

export type ListSitesResponse = ListSitesResponse;

export type RetrieveSnippetResponse = RetrieveSnippetResponse;

export type UpsertSnippetBody = UpsertSnippetRequest;

export type UpsertSnippetResponse = UpsertSnippetResponse;

export type DeleteSnippetResponse = DeleteSnippetResponse;

export type CreateSubscriptionBody = CreateSubscriptionRequest;

export type CreateSubscriptionResponse = CreateSubscriptionResponse;

export type BulkSwapPlanBody = BulkSwapPlanRequest;

export type BulkSwapPlanResponse = BulkSwapPlanResponse;

export type SearchSubscriptionsBody = SearchSubscriptionsRequest;

export type SearchSubscriptionsResponse = SearchSubscriptionsResponse;

export type RetrieveSubscriptionResponse = RetrieveSubscriptionResponse;

export type UpdateSubscriptionBody = UpdateSubscriptionRequest;

export type UpdateSubscriptionResponse = UpdateSubscriptionResponse;

export type DeleteSubscriptionActionResponse = DeleteSubscriptionActionResponse;

export type ChangeBillingAnchorDateBody = ChangeBillingAnchorDateRequest;

export type ChangeBillingAnchorDateResponse = ChangeBillingAnchorDateResponse;

export type CancelSubscriptionResponse = CancelSubscriptionResponse;

export type ListSubscriptionEventsResponse = ListSubscriptionEventsResponse;

export type PauseSubscriptionBody = PauseSubscriptionRequest;

export type PauseSubscriptionResponse = PauseSubscriptionResponse;

export type ResumeSubscriptionBody = ResumeSubscriptionRequest;

export type ResumeSubscriptionResponse = ResumeSubscriptionResponse;

export type SwapPlanBody = SwapPlanRequest;

export type SwapPlanResponse = SwapPlanResponse;

export type CreateTeamMemberBody = CreateTeamMemberRequest;

export type CreateTeamMemberResponse = CreateTeamMemberResponse;

export type BulkCreateTeamMembersBody = BulkCreateTeamMembersRequest;

export type BulkCreateTeamMembersResponse = BulkCreateTeamMembersResponse;

export type BulkUpdateTeamMembersBody = BulkUpdateTeamMembersRequest;

export type BulkUpdateTeamMembersResponse = BulkUpdateTeamMembersResponse;

export type ListJobsResponse = ListJobsResponse;

export type CreateJobBody = CreateJobRequest;

export type CreateJobResponse = CreateJobResponse;

export type RetrieveJobResponse = RetrieveJobResponse;

export type UpdateJobBody = UpdateJobRequest;

export type UpdateJobResponse = UpdateJobResponse;

export type SearchTeamMembersBody = SearchTeamMembersRequest;

export type SearchTeamMembersResponse = SearchTeamMembersResponse;

export type RetrieveTeamMemberResponse = RetrieveTeamMemberResponse;

export type UpdateTeamMemberBody = UpdateTeamMemberRequest;

export type UpdateTeamMemberResponse = UpdateTeamMemberResponse;

export type RetrieveWageSettingResponse = RetrieveWageSettingResponse;

export type UpdateWageSettingBody = UpdateWageSettingRequest;

export type UpdateWageSettingResponse = UpdateWageSettingResponse;

export type CreateTerminalActionBody = CreateTerminalActionRequest;

export type CreateTerminalActionResponse = CreateTerminalActionResponse;

export type SearchTerminalActionsBody = SearchTerminalActionsRequest;

export type SearchTerminalActionsResponse = SearchTerminalActionsResponse;

export type GetTerminalActionResponse = GetTerminalActionResponse;

export type CancelTerminalActionResponse = CancelTerminalActionResponse;

export type DismissTerminalActionResponse = DismissTerminalActionResponse;

export type CreateTerminalCheckoutBody = CreateTerminalCheckoutRequest;

export type CreateTerminalCheckoutResponse = CreateTerminalCheckoutResponse;

export type SearchTerminalCheckoutsBody = SearchTerminalCheckoutsRequest;

export type SearchTerminalCheckoutsResponse = SearchTerminalCheckoutsResponse;

export type GetTerminalCheckoutResponse = GetTerminalCheckoutResponse;

export type CancelTerminalCheckoutResponse = CancelTerminalCheckoutResponse;

export type DismissTerminalCheckoutResponse = DismissTerminalCheckoutResponse;

export type CreateTerminalRefundBody = CreateTerminalRefundRequest;

export type CreateTerminalRefundResponse = CreateTerminalRefundResponse;

export type SearchTerminalRefundsBody = SearchTerminalRefundsRequest;

export type SearchTerminalRefundsResponse = SearchTerminalRefundsResponse;

export type GetTerminalRefundResponse = GetTerminalRefundResponse;

export type CancelTerminalRefundResponse = CancelTerminalRefundResponse;

export type DismissTerminalRefundResponse = DismissTerminalRefundResponse;

export type CreateTransferOrderBody = CreateTransferOrderRequest;

export type CreateTransferOrderResponse = CreateTransferOrderResponse;

export type SearchTransferOrdersBody = SearchTransferOrdersRequest;

export type SearchTransferOrdersResponse = SearchTransferOrdersResponse;

export type RetrieveTransferOrderResponse = RetrieveTransferOrderResponse;

export type UpdateTransferOrderBody = UpdateTransferOrderRequest;

export type UpdateTransferOrderResponse = UpdateTransferOrderResponse;

export type DeleteTransferOrderResponse = DeleteTransferOrderResponse;

export type CancelTransferOrderBody = CancelTransferOrderRequest;

export type CancelTransferOrderResponse = CancelTransferOrderResponse;

export type ReceiveTransferOrderBody = ReceiveTransferOrderRequest;

export type ReceiveTransferOrderResponse = ReceiveTransferOrderResponse;

export type StartTransferOrderBody = StartTransferOrderRequest;

export type StartTransferOrderResponse = StartTransferOrderResponse;

export type BulkCreateVendorsBody = BulkCreateVendorsRequest;

export type BulkCreateVendorsResponse = BulkCreateVendorsResponse;

export type BulkRetrieveVendorsBody = BulkRetrieveVendorsRequest;

export type BulkRetrieveVendorsResponse = BulkRetrieveVendorsResponse;

export type BulkUpdateVendorsBody = BulkUpdateVendorsRequest;

export type BulkUpdateVendorsResponse = BulkUpdateVendorsResponse;

export type CreateVendorBody = CreateVendorRequest;

export type CreateVendorResponse = CreateVendorResponse;

export type SearchVendorsBody = SearchVendorsRequest;

export type SearchVendorsResponse = SearchVendorsResponse;

export type RetrieveVendorResponse = RetrieveVendorResponse;

export type UpdateVendorBody = UpdateVendorRequest;

export type UpdateVendorResponse = UpdateVendorResponse;

export type ListWebhookEventTypesResponse = ListWebhookEventTypesResponse;

export type ListWebhookSubscriptionsResponse = ListWebhookSubscriptionsResponse;

export type CreateWebhookSubscriptionBody = CreateWebhookSubscriptionRequest;

export type CreateWebhookSubscriptionResponse = CreateWebhookSubscriptionResponse;

export type RetrieveWebhookSubscriptionResponse = RetrieveWebhookSubscriptionResponse;

export type UpdateWebhookSubscriptionBody = UpdateWebhookSubscriptionRequest;

export type UpdateWebhookSubscriptionResponse = UpdateWebhookSubscriptionResponse;

export type DeleteWebhookSubscriptionResponse = DeleteWebhookSubscriptionResponse;

export type UpdateWebhookSubscriptionSignatureKeyBody = UpdateWebhookSubscriptionSignatureKeyRequest;

export type UpdateWebhookSubscriptionSignatureKeyResponse = UpdateWebhookSubscriptionSignatureKeyResponse;

export type TestWebhookSubscriptionBody = TestWebhookSubscriptionRequest;

export type TestWebhookSubscriptionResponse = TestWebhookSubscriptionResponse;
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall