export type CountryType = | "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"; export type CurrencyType = | "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" | "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"; export type DayOfWeekType = "SUN" | "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT"; export type CardBrandType = | "JCB" | "VISA" | "DISCOVER" | "MASTERCARD" | "OTHER_BRAND" | "CHINA_UNIONPAY" | "DISCOVER_DINERS" | "AMERICAN_EXPRESS" | "SQUARE_GIFT_CARD"; export type SortOrderType = "ASC" | "DESC"; export type TaxType = "ADDITIVE" | "INCLUSIVE" | "UNKNOWN_TAX"; export type TaxApplicationScopeType = "ORDER" | "LINE_ITEM" | "OTHER_TAX_SCOPE"; export type DiscountType = | "FIXED_AMOUNT" | "FIXED_PERCENTAGE" | "VARIABLE_AMOUNT" | "VARIABLE_PERCENTAGE" | "UNKNOWN_DISCOUNT"; export type DiscountApplicationScopeType = "ORDER" | "LINE_ITEM" | "OTHER_DISCOUNT_SCOPE"; export type CustomerSourceType = | "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"; export type InventoryStateType = | "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"; export type ActivityStatusType = "ACTIVE" | "INACTIVE"; export type FulfillmentType = "PICKUP" | "SHIPMENT"; export type FulfillmentStateType = "PROPOSED" | "RESERVED" | "PREPARED" | "COMPLETED" | "CANCELED" | "FAILED"; export type InventoryType = "PHYSICAL_COUNT" | "ADJUSTMENT" | "TRANSFER"; export type ObjectType = | "ITEM" | "IMAGE" | "CATEGORY" | "ITEM_VARIATION" | "TAX" | "DISCOUNT" | "MODIFIER_LIST" | "MODIFIER"; export type PricingType = "FIXED_PRICING" | "VARIABLE_PRICING"; export type OrderStateType = "OPEN" | "COMPLETED" | "CANCELED"; export type AreaUnitType = | "IMPERIAL_ACRE" | "IMPERIAL_SQUARE_INCH" | "IMPERIAL_SQUARE_FOOT" | "IMPERIAL_SQUARE_YARD" | "IMPERIAL_SQUARE_MILE" | "METRIC_SQUARE_METER" | "METRIC_SQUARE_KILOMETER" | "METRIC_SQUARE_CENTIMETER"; export type LengthUnitType = | "IMPERIAL_INCH" | "IMPERIAL_FOOT" | "IMPERIAL_YARD" | "IMPERIAL_MILE" | "METRIC_MILLIMETER" | "METRIC_CENTIMETER" | "METRIC_METER" | "METRIC_KILOMETER"; export type VolumeUnitType = | "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"; export type WeightUnitType = | "IMPERIAL_WEIGHT_OUNCE" | "IMPERIAL_POUND" | "IMPERIAL_STONE" | "METRIC_MILLIGRAM" | "METRIC_GRAM" | "METRIC_KILOGRAM"; export type ErrorCategoryType = | "API_ERROR" | "AUTHENTICATION_ERROR" | "INVALID_REQUEST_ERROR" | "RATE_LIMIT_ERROR" | "PAYMENT_METHOD_ERROR" | "REFUND_ERROR"; export type ErrorCodeType = | "INTERNAL_SERVER_ERROR" | "UNAUTHORIZED" | "ACCESS_TOKEN_EXPIRED" | "ACCESS_TOKEN_REVOKED" | "FORBIDDEN" | "INSUFFICIENT_SCOPES" | "APPLICATION_DISABLED" | "V1_APPLICATION" | "V1_ACCESS_TOKEN" | "CARD_PROCESSING_NOT_ENABLED" | "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" | "ONE_INSTRUMENT_EXPECTED" | "NO_FIELDS_SET" | "DEPRECATED_FIELD_SET" | "CARD_EXPIRED" | "INVALID_EXPIRATION" | "INVALID_EXPIRATION_YEAR" | "INVALID_EXPIRATION_DATE" | "UNSUPPORTED_CARD_BRAND" | "UNSUPPORTED_ENTRY_METHOD" | "INVALID_ENCRYPTED_CARD" | "INVALID_CARD" | "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" | "INVALID_CARD_DATA" | "LOCATION_MISMATCH" | "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_DECLINED" | "VERIFY_CVV_FAILURE" | "VERIFY_AVS_FAILURE" | "CARD_DECLINED_CALL_ISSUER" | "NOT_FOUND" | "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "REQUEST_ENTITY_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "RATE_LIMITED" | "NOT_IMPLEMENTED" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT"; export type ProductSourceType = | "SQUARE_POS" | "EXTERNAL_API" | "BILLING" | "APPOINTMENTS" | "INVOICES" | "ONLINE_STORE" | "PAYROLL" | "DASHBOARD" | "ITEM_LIBRARY_IMPORT" | "OTHER"; /** * Defines request parameters for the AcceptDispute endpoint. */ export class AcceptDisputeRequest {} /** * Defines fields in a AcceptDispute response. */ export class AcceptDisputeResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * Details about the accepted dispute. */ dispute?: Dispute | undefined; } /** * A request to accumulate points for a purchase. */ export class AccumulateLoyaltyPointsRequest { /** * The points to add to the account. If you are using the Orders API to manage orders, you specify the order ID. * Otherwise, specify the points to add. */ accumulate_points: LoyaltyEventAccumulatePoints; /** * A unique string that identifies the `AccumulateLoyaltyPoints` request. * Keys can be any valid string but must be unique for every request. */ idempotency_key: string; /** * The `location` where the purchase was made. */ location_id: string; } /** * A response containing the resulting loyalty event. */ export class AccumulateLoyaltyPointsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The resulting loyalty event. */ event?: LoyaltyEvent | undefined; } export class ActionCancelReason {} /** * Defines the fields that are included in the request body of a request * to the [AddGroupToCustomer](#endpoint-addgrouptocustomer) endpoint. */ export class AddGroupToCustomerRequest {} /** * Defines the fields that are included in the response body of a request * to the [AddGroupToCustomer](#endpoint-addgrouptocustomer) endpoint. */ export class AddGroupToCustomerResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Represents an additional recipient (other than the merchant) receiving a portion of this tender. */ export class AdditionalRecipient { /** * The location ID for a recipient (other than the merchant) receiving a portion of this tender. */ location_id: string; /** * The description of the additional recipient. */ description: string; /** * The amount of money distributed to the recipient. */ amount_money: Money; /** * The unique ID for this `AdditionalRecipientReceivable`, assigned by the server. */ receivable_id?: string | undefined; } /** * Represents a physical address. */ export class Address { /** * The first line of the address. Fields that start with `address_line` provide the address's most specific * details, like street number, street name, and building name. They do *not* provide less specific details like * city, state/province, or country (these details are provided in other fields). */ address_line_1?: string | undefined; /** * The second line of the address, if any. */ address_line_2?: string | undefined; /** * The third line of the address, if any. */ address_line_3?: string | undefined; /** * The city or town of the address. */ locality?: string | undefined; /** * A civil region within the address's `locality`, if any. */ sublocality?: string | undefined; /** * A civil region within the address's `sublocality`, if any. */ sublocality_2?: string | undefined; /** * A civil region within the address's `sublocality_2`, if any. */ sublocality_3?: string | undefined; /** * A civil entity within the address's country. In the US, this is the state. */ administrative_district_level_1?: string | undefined; /** * A civil entity within the address's `administrative_district_level_1`. In the US, this is the county. */ administrative_district_level_2?: string | undefined; /** * A civil entity within the address's `administrative_district_level_2`, if any. */ administrative_district_level_3?: string | undefined; /** * The address's postal code. */ postal_code?: string | undefined; /** * The address's country, in ISO 3166-1-alpha-2 format. See [Country](#type-country) for possible values */ country?: CountryType | undefined; /** * Optional first name when it's representing recipient. */ first_name?: string | undefined; /** * Optional last name when it's representing recipient. */ last_name?: string | undefined; /** * Optional organization name when it's representing recipient. */ organization?: string | undefined; } /** * A request to adjust (add or subtract) points manually. */ export class AdjustLoyaltyPointsRequest { /** * A unique string that identifies this `AdjustLoyaltyPoints` request. * Keys can be any valid string, but must be unique for every request. */ idempotency_key: string; /** * The points to adjust (add or subtract) and the reason for the adjustment. */ adjust_points: LoyaltyEventAdjustPoints; } /** * A response that includes the loyalty event that resulted from the successful API call. */ export class AdjustLoyaltyPointsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The resulting event data for adjusting points. */ event?: LoyaltyEvent | undefined; } /** * Reflects the current status of a balance payment. */ export class BalancePaymentDetails { /** * ID for the account used to fund the payment. */ account_id?: string | undefined; /** * The balance payment’s current state. Can be `COMPLETED` or `FAILED`. */ status?: string | undefined; } /** * Represents a bank account. * For more information about linking a bank account to a Square account, see [Bank Accounts API](/docs/bank-accounts-api). */ export class BankAccount { /** * The unique, Square-issued identifier for the bank account. */ id: string; /** * The last few digits of the account number. */ account_number_suffix: string; /** * The ISO 3166 Alpha-2 country code where the bank account is based. See [Country](#type-country) for possible values */ country: string; /** * The 3-character ISO 4217 currency code indicating the operating currency of the bank account. * For example, the currency code for US dollars is `USD`. See [Currency](#type-currency) for possible values */ currency: string; /** * The financial purpose of the associated bank account. See [BankAccountType](#type-bankaccounttype) for possible values */ account_type: string; /** * Name of the account holder. This name must match the name on the targeted bank account record. */ holder_name: string; /** * Primary identifier for the bank. For more information, see [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). */ primary_bank_identification_number: string; /** * Secondary identifier for the bank. For more information, see [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api). */ secondary_bank_identification_number?: string | undefined; /** * Reference identifier that will be displayed to UK bank account owners when collecting direct debit authorization. Only required for UK bank accounts. */ debit_mandate_reference_id?: string | undefined; /** * Client-provided identifier for linking the banking account to an entity in a third-party system (for example, a bank account number or a user identifier). */ reference_id?: string | undefined; /** * The location to which the bank account belongs. */ location_id?: string | undefined; /** * Read-only. The current verification status of this BankAccount object. See [BankAccountStatus](#type-bankaccountstatus) for possible values */ status: string; /** * Indicates whether it is possible for Square to send money to this bank account. */ creditable: boolean; /** * Indicates whether it is possible for Square to take money from this bank account. */ debitable: boolean; /** * A Square-assigned, unique identifier for the bank account based on the account information. * The account fingerprint can be used to compare account entries and determine if the they represent the same real-world bank account. */ fingerprint?: string | undefined; /** * The current version of the `BankAccount`. */ version?: number | undefined; /** * Read only. Name of actual financial institution. For example \"Bank of America\". */ bank_name?: string | undefined; } /** * Indicates the current verification status of a `BankAccount` object. */ export class BankAccountStatus {} /** * Indicates the financial purpose of the bank account. */ export class BankAccountType {} export class BatchChangeInventoryRequest { /** * A client-supplied, universally unique identifier (UUID) for the request. * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) in the * [API Development 101](https://developer.squareup.com/docs/basics/api101/overview) section for more information. */ idempotency_key?: string | undefined; /** * The set of physical counts and inventory adjustments to be made. * Changes are applied based on the client-supplied timestamp and may be sent out of order. */ changes?: InventoryChange[] | undefined; /** * Indicates whether the current physical count should be ignored if the quantity is unchanged since the last physical count. * Default: `true`. */ ignore_unchanged_counts?: boolean | undefined; } export class BatchChangeInventoryResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The current counts for all objects referenced in the request. */ counts?: InventoryCount[] | undefined; } export class BatchDeleteCatalogObjectsRequest { /** * The IDs of the CatalogObjects to be deleted. When an object is deleted, other objects in the graph that depend on * that object will be deleted as well (for example, deleting a CatalogItem will delete its CatalogItemVariation. */ object_ids?: string[] | undefined; } export class BatchDeleteCatalogObjectsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The IDs of all CatalogObjects deleted by this request. */ deleted_object_ids?: string[] | undefined; /** * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this deletion * in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". */ deleted_at?: string | undefined; } export class BatchRetrieveCatalogObjectsRequest { /** * The IDs of the CatalogObjects to be retrieved. */ object_ids: string[]; /** * If `true`, the response will include additional objects that are related to the requested objects, as follows: * * If the `objects` field of the response contains a CatalogItem, its associated CatalogCategory objects, CatalogTax objects, * CatalogImage objects and CatalogModifierLists will be returned in the `related_objects` field of the response. * * If the `objects` field of the response contains a CatalogItemVariation, its parent CatalogItem will be returned * in the `related_objects` field of the response. */ include_related_objects?: boolean | undefined; } export class BatchRetrieveCatalogObjectsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * A list of `CatalogObject`s returned. */ objects?: CatalogObject[] | undefined; /** * A list of `CatalogObject`s referenced by the object in the `objects` field. */ related_objects?: CatalogObject[] | undefined; } export class BatchRetrieveInventoryChangesRequest { /** * The filter to return results by `CatalogObject` ID. The filter is only applicable when set. The default value is null. */ catalog_object_ids?: string[] | undefined; /** * The filter to return results by `Location` ID. The filter is only applicable when set. The default value is null. */ location_ids?: string[] | undefined; /** * The filter to return results by `InventoryChangeType` values other than `TRANSFER`. * The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. See [InventoryChangeType](#type-inventorychangetype) for possible values. */ types?: InventoryType[] | undefined; /** * The filter to return `ADJUSTMENT` query results by `InventoryState`. This filter is only applied when set. * The default value is null. See [InventoryState](#type-inventorystate) for possible values. */ states?: InventoryStateType[] | undefined; /** * The filter to return results with their `calculated_at` value after the given time as specified in an RFC 3339 timestamp. * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). */ updated_after?: string | undefined; /** * The filter to return results with their `created_at` or `calculated_at` value strictly before the given time as specified in an RFC 3339 timestamp. * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). */ updated_before?: string | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; } export class BatchRetrieveInventoryChangesResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The current calculated inventory changes for the requested objects and locations. */ changes?: InventoryChange[] | undefined; /** * The pagination cursor to be used in a subsequent request. If unset, this is the final response. * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; } export class BatchRetrieveInventoryCountsRequest { /** * The filter to return results by `CatalogObject` ID. The filter is applicable only when set. The default is null. */ catalog_object_ids?: string[] | undefined; /** * The filter to return results by `Location` ID. This filter is applicable only when set. The default is null. */ location_ids?: string[] | undefined; /** * The filter to return results with their `calculated_at` value after the given time as specified in an RFC 3339 timestamp. * The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). */ updated_after?: string | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; /** * The filter to return results by `InventoryState`. The filter is only applicable when set. * Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. The default is null. * See [InventoryState](#type-inventorystate) for possible values. */ states?: string[] | undefined; } export class BatchRetrieveInventoryCountsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The current calculated inventory counts for the requested objects and locations. */ counts?: InventoryCount[] | undefined; /** * The pagination cursor to be used in a subsequent request. If unset, this is the final response. * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; } export class BatchRetrieveOrdersRequest { /** * The ID of the location for these orders. * This field is optional: omit it to retrieve orders within the scope of the current authorization's merchant ID. */ location_id?: string | undefined; /** * The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request. */ order_ids: string[]; } /** * Defines the fields that are included in the response body of a request to the BatchRetrieveOrders endpoint. */ export class BatchRetrieveOrdersResponse { /** * The requested orders. This will omit any requested orders that do not exist. */ orders?: Order[] | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class BatchUpsertCatalogObjectsRequest { /** * A value you specify that uniquely identifies this request among all your requests. A common way to create a valid * idempotency key is to use a Universally unique identifier (UUID). If you're unsure whether a particular request was * successful, you can reattempt it with the same idempotency key without worrying about creating duplicate objects. * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ idempotency_key: string; /** * A batch of CatalogObjects to be inserted/updated atomically. The objects within a batch will be inserted in an * all-or-nothing fashion, i.e., if an error occurs attempting to insert or update an object within a batch, the entire * batch will be rejected. However, an error in one batch will not affect other batches within the same request. * For each object, its `updated_at` field is ignored and replaced with a current * [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), and its `is_deleted` field must * not be set to `true`. To modify an existing object, supply its ID. To create a new object, use an ID starting with `#`. * These IDs may be used to create relationships between an object and attributes of other objects that reference it. * For example, you can create a CatalogItem with ID `#ABC` and a CatalogItemVariation with its `item_id` attribute * set to `#ABC` in order to associate the CatalogItemVariation with its parent CatalogItem. * Any `#`-prefixed IDs are valid only within a single atomic batch, and will be replaced by server-generated IDs. * Each batch may contain up to 1,000 objects. The total number of objects across all batches for a single request * may not exceed 10,000. If either of these limits is violated, an error will be returned and no objects * will be inserted or updated. */ batches: CatalogObjectBatch[]; } export class BatchUpsertCatalogObjectsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The created successfully created CatalogObjects. */ objects?: CatalogObject[] | undefined; /** * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update * in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". */ updated_at?: string | undefined; /** * The mapping between client and server IDs for this upsert. */ id_mappings?: CatalogIdMapping[] | undefined; } /** * A defined break template that sets an expectation for possible `Break` instances on a `Shift`. */ export class BreakType { /** * UUID for this object. */ id?: string | undefined; /** * The ID of the business location this type of break applies to. */ location_id: string; /** * A human-readable name for this type of break. Will be displayed to employees in Square products. */ break_name: string; /** * Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of this break. Precision below minutes is truncated. */ expected_duration: string; /** * Whether this break counts towards time worked for compensation purposes. */ is_paid: boolean; /** * Used for resolving concurrency issues; request will fail if version provided does not match server version at time of request. * If a value is not provided, Square's servers execute a "blind" write; potentially overwriting another writer's data. */ version?: number | undefined; /** * A read-only timestamp in RFC 3339 format. */ created_at?: string | undefined; /** * A read-only timestamp in RFC 3339 format. */ updated_at?: string | undefined; } /** * Represents a bulk create request for `TeamMember` objects. */ export class BulkCreateTeamMembersRequest { /** * The data which will be used to create the `TeamMember` objects. * Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`. */ team_members: Record; } /** * Represents a response from a bulk create request, containing the created `TeamMember` objects or error messages. */ export class BulkCreateTeamMembersResponse { /** * The successfully created `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`. */ team_members: Record; /** * The errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Represents a bulk update request for `TeamMember` objects. */ export class BulkUpdateTeamMembersRequest { /** * The data which will be used to update the `TeamMember` objects. * Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`. */ team_members: Record; } /** * Represents a response from a bulk update request, containing the updated `TeamMember` objects or error messages. */ export class BulkUpdateTeamMembersResponse { /** * The successfully updated `TeamMember` objects. * Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`. */ team_members: Record; /** * The errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Represents the hours of operation for a business location. */ export class BusinessHours { /** * The list of time periods during which the business is open. There may be at most 10 periods per day. */ periods?: BusinessHoursPeriod[] | undefined; } /** * Represents a period of time during which a business location is open. */ export class BusinessHoursPeriod { /** * The day of week for this time period. See [DayOfWeek](#type-dayofweek) for possible values */ day_of_week?: DayOfWeekType | undefined; /** * The start time of a business hours period, specified in local time using partial-time RFC3339 format. */ start_local_time?: string | undefined; /** * The end time of a business hours period, specified in local time using partial-time RFC3339 format. */ end_local_time?: string | undefined; } /** * A request to calculate the points that a buyer can earn from a specified purchase. */ export class CalculateLoyaltyPointsRequest { /** * The `order` ID for which to calculate the points. * Specify this field if your application uses the Orders API to process orders. * Otherwise, specify the `transaction_amount`. */ order_id?: string | undefined; /** * The purchase amount for which to calculate the points. * Specify this field if your application does not use the Orders API to process orders. * Otherwise, specify the `order_id`. */ transaction_amount_money?: Money | undefined; } /** * A response that includes the points that the buyer can earn from a specified purchase. */ export class CalculateLoyaltyPointsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The points that the buyer can earn from a specified purchase. */ points?: number | undefined; } export class CalculateOrderRequest { /** * The order to be calculated. Expects the entire order, not a sparse update. */ order: Order; /** * Identifies one or more loyalty reward tiers to apply during order calculation. * The discounts defined by the reward tiers are added to the order only to preview the effect of applying the specified reward(s). * The reward(s) do not correspond to actual redemptions, that is, no `reward`s are created. * Therefore, the reward `id`s are random strings used only to reference the reward tier. */ proposed_rewards?: OrderReward[] | undefined; } export class CalculateOrderResponse { /** * The calculated version of the order provided in the request. */ order?: Order | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Describes a `CancelInvoice` request. */ export class CancelInvoiceRequest { /** * The version of the `invoice` to cancel. * If you do not know the version, you can call `GetInvoice](#endpoint-Invoices-GetInvoice) or [ListInvoices`. */ version: number; } /** * The response returned by the `CancelInvoice` request. */ export class CancelInvoiceResponse { /** * The canceled invoice. */ invoice?: Invoice | undefined; /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; } /** * Specifies the idempotency key of a payment to cancel. */ export class CancelPaymentByIdempotencyKeyRequest { /** * The `idempotency_key` identifying the payment to be canceled. */ idempotency_key: string; } /** * The return value from the [CancelPaymentByIdempotencyKey](#endpoint-payments-cancelpaymentbyidempotencykey) endpoint. * On success, `errors` is empty. */ export class CancelPaymentByIdempotencyKeyResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Cancels (voids) a payment before it has been completed. * @note Only payments created with `autocomplete` set to `false` can be canceled. */ export class CancelPaymentRequest {} /** * The return value from the [CancelPayment](#endpoint-payments-cancelpayment) endpoint. */ export class CancelPaymentResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The successfully canceled `Payment` object. */ payment?: Payment | undefined; } /** * Defines parameters in a [CancelSubscription](#endpoint-subscriptions-cancelsubscription) endpoint request. */ export class CancelSubscriptionRequest {} /** * Defines fields that are included in a [CancelSubscription](#endpoint-subscriptions-cancelsubscription) response. */ export class CancelSubscriptionResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The canceled subscription. */ subscription?: Subscription | undefined; } export class CancelTerminalCheckoutRequest {} export class CancelTerminalCheckoutResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The canceled `TerminalCheckout` */ checkout?: TerminalCheckout | undefined; } export class CancelTerminalRefundRequest {} export class CancelTerminalRefundResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The updated `TerminalRefund` */ refund?: TerminalRefund | undefined; } /** * Defines the query parameters for calls to the CaptureTransaction endpoint. */ export class CaptureTransactionRequest {} /** * Defines the fields that are included in the response body of a request to the [CaptureTransaction](#endpoint-capturetransaction) endpoint. */ export class CaptureTransactionResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Represents the payment details of a card to be used for payments. * These details are determined by the `card_nonce` generated by `SqPaymentForm`. */ export class Card { /** * Unique ID for this card. Generated by Square. */ id?: string | undefined; /** * The card's brand. See [CardBrand](#type-cardbrand) for possible values */ card_brand?: CardBrandType | undefined; /** * The last 4 digits of the card number. */ last_4?: string | undefined; /** * The expiration month of the associated card as an integer between 1 and 12. */ exp_month?: number | undefined; /** * The four-digit year of the card's expiration date. */ exp_year?: number | undefined; /** * The name of the cardholder. */ cardholder_name?: string | undefined; /** * The billing address for this card. */ billing_address?: Address | undefined; /** * @proposed Intended as a Square-assigned identifier, based on the card number, to identify the card across * multiple locations within a single application. */ fingerprint?: string | undefined; /** * The type of the card. The Card object includes this field only in response to Payments API calls. * See [CardType](#type-cardtype) for possible values. */ card_type?: string | undefined; /** * Indicates whether the Card is prepaid or not. The Card object includes this field only in response to Payments API calls. * See [CardPrepaidType](#type-cardprepaidtype) for possible values. */ prepaid_type?: string | undefined; /** * The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API returns this field. */ bin?: string | undefined; } /** * Indicates a card's brand, such as `VISA` or `MASTERCARD`. */ export class CardBrand {} /** * Reflects the current status of a card payment. */ export class CardPaymentDetails { /** * The card payment's current state. It can be one of: `AUTHORIZED`, `CAPTURED`, `VOIDED`, `FAILED`. */ status?: string | undefined; /** * The credit card's non-confidential details. */ card?: Card | undefined; /** * The method used to enter the card's details for the payment. Can be `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. */ entry_method?: string | undefined; /** * Status code returned from the Card Verification Value (CVV) check. Can be `CVV_ACCEPTED`, `CVV_REJECTED`, `CVV_NOT_CHECKED`. */ cvv_status?: string | undefined; /** * Status code returned from the Address Verification System (AVS) check. Can be `AVS_ACCEPTED`, `AVS_REJECTED`, `AVS_NOT_CHECKED`. */ avs_status?: string | undefined; /** * Status code returned by the card issuer that describes the payment's authorization status. */ auth_result_code?: string | undefined; /** * For EMV payments, identifies the EMV application used for the payment. */ application_identifier?: string | undefined; /** * For EMV payments, the human-readable name of the EMV application used for the payment. */ application_name?: string | undefined; /** * For EMV payments, the cryptogram generated for the payment. */ application_cryptogram?: string | undefined; /** * For EMV payments, method used to verify the cardholder's identity. * Can be one of `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`. */ verification_method?: string | undefined; /** * For EMV payments, the results of the cardholder verification. */ verification_results?: "SUCCESS" | "FAILURE" | "UNKNOWN" | undefined; /** * The statement description sent to the card networks. * @note The actual statement description will vary and is likely to be truncated and appended with additional * information on a per issuer basis. */ statement_description?: string | undefined; /** * Details about the device that took the payment. */ device_details?: DeviceDetails | undefined; /** * Whether or not the card is required to be physically present in order for the payment to be refunded. * If true, the card is required to be present. */ refund_requires_card_presence: boolean; /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; } /** * Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. */ export class CardPrepaidType {} export class CardSquareProduct {} /** * Indicates a card's type, such as `CREDIT` or `DEBIT`. */ export class CardType {} export class CashDrawerDevice { /** * The device Square-issued ID */ id?: string | undefined; /** * The device merchant-specified name. */ name?: string | undefined; } /** * The types of events on a CashDrawerShift. Each event type represents an employee action on the actual cash drawer * represented by a CashDrawerShift. */ export class CashDrawerEventType {} /** * 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 class CashDrawerShift { /** * The shift unique ID. */ id?: string | undefined; /** * The shift current state. See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values. */ state?: string | undefined; /** * The time when the shift began, in ISO 8601 format. */ opened_at?: string | undefined; /** * The time when the shift ended, in ISO 8601 format. */ ended_at?: string | undefined; /** * The time when the shift was closed, in ISO 8601 format. */ closed_at?: string | undefined; /** * The IDs of all employees that were logged into Square Point of Sale at any point while the cash drawer shift was open. */ employee_ids?: string[] | undefined; /** * The ID of the employee that started the cash drawer shift. */ opening_employee_id?: string | undefined; /** * The ID of the employee that ended the cash drawer shift. */ ending_employee_id?: string | undefined; /** * The ID of the employee that closed the cash drawer shift by auditing the cash drawer contents. */ closing_employee_id?: string | undefined; /** * The free-form text description of a cash drawer by an employee. */ description?: string | undefined; /** * The amount of money in the cash drawer at the start of the shift. The amount must be greater than or equal to zero. */ opened_cash_money?: Money | undefined; /** * The amount of money added to the cash drawer from cash payments. * This is computed by summing all events with the types CASH_TENDER_PAYMENT and CASH_TENDER_CANCELED_PAYMENT. * The amount is always greater than or equal to zero. */ cash_payment_money?: Money | undefined; /** * The amount of money removed from the cash drawer from cash refunds. * It is computed by summing the events of type CASH_TENDER_REFUND. The amount is always greater than or equal to zero. */ cash_refunds_money?: Money | undefined; /** * The amount of money added to the cash drawer for reasons other than cash payments. * It is computed by summing the events of type PAID_IN. The amount is always greater than or equal to zero. */ cash_paid_in_money?: Money | undefined; /** * The amount of money removed from the cash drawer for reasons other than cash refunds. * It is computed by summing the events of type PAID_OUT. The amount is always greater than or equal to zero. */ cash_paid_out_money?: Money | undefined; /** * The amount of money that should be in the cash drawer at the end of the shift, based on the shift's other money amounts. * This can be negative if employees have not correctly recorded all the events on the cash drawer. * cash_paid_out_money is a summation of amounts from cash_payment_money (zero or positive), cash_refunds_money * (zero or negative), cash_paid_in_money (zero or positive), and cash_paid_out_money (zero or negative) event types. */ expected_cash_money?: Money | undefined; /** * The amount of money found in the cash drawer at the end of the shift by an auditing employee. The amount should be positive. */ closed_cash_money?: Money | undefined; /** * The device running Square Point of Sale that was connected to the cash drawer. */ device?: CashDrawerDevice | undefined; } export class CashDrawerShiftEvent { /** * The unique ID of the event. */ id?: string | undefined; /** * The ID of the employee that created the event. */ employee_id?: string | undefined; /** * The type of cash drawer shift event. See [CashDrawerEventType](#type-cashdrawereventtype) for possible values */ event_type?: string | undefined; /** * The amount of money that was added to or removed from the cash drawer in the event. * The amount can be positive (for added money), negative (for removed money), or zero (for other tender type payments). */ event_money?: Money | undefined; /** * The event time in ISO 8601 format. */ created_at?: string | undefined; /** * An optional description of the event, entered by the employee that created the event. */ description?: string | undefined; } /** * The current state of a cash drawer shift. */ export class CashDrawerShiftState {} /** * 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 class CashDrawerShiftSummary { /** * The shift unique ID. */ id?: string | undefined; /** * The shift current state. See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values. */ state?: string | undefined; /** * The shift start time in ISO 8601 format. */ opened_at?: string | undefined; /** * The shift end time in ISO 8601 format. */ ended_at?: string | undefined; /** * The shift close time in ISO 8601 format. */ closed_at?: string | undefined; /** * An employee free-text description of a cash drawer shift. */ description?: string | undefined; /** * The amount of money in the cash drawer at the start of the shift. This must be a positive amount. */ opened_cash_money?: Money | undefined; /** * The amount of money that should be in the cash drawer at the end of the shift, based on the cash drawer events on the shift. * The amount is correct if all shift employees accurately recorded their cash drawer shift events. * Unrecorded events and events with the wrong amount result in an incorrect expected_cash_money amount that can be negative. */ expected_cash_money?: Money | undefined; /** * The amount of money found in the cash drawer at the end of the shift by an auditing employee. * The amount must be greater than or equal to zero. */ closed_cash_money?: Money | undefined; } /** * A category to which a `CatalogItem` instance belongs. */ export class CatalogCategory { /** * The category name. * This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. */ name?: string | undefined; } /** * 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](/catalog-api/add-custom-attributes) */ export class CatalogCustomAttributeDefinition { /** * The type of this custom attribute. Cannot be modified after creation. Required. * See [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) for possible values. */ type: string; /** * The name of this definition for API and seller-facing UI purposes. * The name must be unique within the (merchant, application) pair. Required. * May not be empty and may not exceed 255 characters. Can be modified after creation. */ name: string; /** * Seller-oriented description of the meaning of this Custom Attribute, any constraints that the seller should observe, etc. * May be displayed as a tooltip in Square UIs. */ description?: string | undefined; /** * Contains information about the application that created this custom attribute definition. */ readonly source_application?: SourceApplication | undefined; /** * The set of Catalog Object Types that this Custom Attribute may be applied to. * Currently, only `ITEM` and `ITEM_VARIATION` are allowed. At least one type must be included. * See [CatalogObjectType](#type-catalogobjecttype) for possible values. */ allowed_object_types: string[]; /** * The visibility of a custom attribute in seller-facing UIs (including Square Point of Sale applications and * Square Dashboard). May be modified. * See [CatalogCustomAttributeDefinitionSellerVisibility](#type-catalogcustomattributedefinitionsellervisibility) for possible values. */ seller_visibility?: string | undefined; /** * The visibility of a custom attribute to applications other than the application that created the attribute. * See [CatalogCustomAttributeDefinitionAppVisibility](#type-catalogcustomattributedefinitionappvisibility) for possible values. */ app_visibility?: string | undefined; /** * Optionally, populated when `type` = `STRING`, unset otherwise. */ string_config?: CatalogCustomAttributeDefinitionStringConfig | undefined; /** * Optionally, populated when `type` = `NUMBER`, unset otherwise. */ number_config?: CatalogCustomAttributeDefinitionNumberConfig | undefined; /** * Populated when `type` is set to `SELECTION`, unset otherwise. */ selection_config?: CatalogCustomAttributeDefinitionSelectionConfig | undefined; /** * The number of custom attributes that reference this custom attribute definition. * Set by the server in response to a ListCatalog request with `include_counts` set to `true`. * If the actual count is greater than 100, `custom_attribute_usage_count` will be set to `100`. */ readonly custom_attribute_usage_count?: number | undefined; /** * The name of the desired custom attribute key that can be used to access the custom attribute value on catalog objects. * Cannot be modified after the custom attribute definition has been created. * Must be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`. */ key?: string | undefined; } /** * Defines the visibility of a custom attribute to applications other than their creating application. */ export class CatalogCustomAttributeDefinitionAppVisibility {} export class CatalogCustomAttributeDefinitionNumberConfig { /** * An integer between 0 and 5 that represents the maximum number of positions allowed after the decimal in number custom attribute values For example: * - if the precision is 0, the quantity can be 1, 2, 3, etc. * - if the precision is 1, the quantity can be 0.1, 0.2, etc. * - if the precision is 2, the quantity can be 0.01, 0.12, etc. * Default: 5 */ precision?: number | undefined; } /** * Configuration associated with `SELECTION`-type custom attribute definitions. */ export class CatalogCustomAttributeDefinitionSelectionConfig { /** * The maximum number of selections that can be set. The maximum value for this attribute is 100. The default value is 1. * The value can be modified, but changing the value will not affect existing custom attribute values on objects. * Clients need to handle custom attributes with more selected values than allowed by this limit. */ max_allowed_selections?: number | undefined; /** * The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100 selections can be defined. Can be modified. */ allowed_selections?: CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection[] | undefined; } /** * A named selection for this `SELECTION`-type custom attribute definition. */ export class CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection { /** * Unique ID set by Square. */ uid?: string | undefined; /** * Selection name, unique within `allowed_selections`. */ 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 class CatalogCustomAttributeDefinitionSellerVisibility {} /** * Configuration associated with Custom Attribute Definitions of type `STRING`. */ export class CatalogCustomAttributeDefinitionStringConfig { /** * If true, each Custom Attribute instance associated with this Custom Attribute Definition must have a unique value * within the seller's catalog. For example, this may be used for a value like a SKU that should not be duplicated * within a seller's catalog. May not be modified after the definition has been created. */ enforce_uniqueness?: boolean | undefined; } /** * Defines the possible types for a custom attribute. */ export class CatalogCustomAttributeDefinitionType {} /** * 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](/catalog-api/add-custom-attributes). */ export class CatalogCustomAttributeValue { /** * The name of the custom attribute. */ name?: string | undefined; /** * The string value of the custom attribute. Populated if `type` = `STRING`. */ string_value?: string | undefined; /** * The id of the `CatalogCustomAttributeDefinition` this value belongs to. */ readonly custom_attribute_definition_id?: string | undefined; /** * A copy of type from the associated `CatalogCustomAttributeDefinition`. * See [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) for possible values. */ readonly type?: string | undefined; /** * Populated if `type` = `NUMBER`. Contains a string representation of a decimal number, using a `.` as the decimal separator. */ number_value?: string | undefined; /** * A `true` or `false` value. Populated if `type` = `BOOLEAN`. */ boolean_value?: boolean | undefined; /** * One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. */ selection_uid_values?: string[] | undefined; /** * A copy of key from the associated `CatalogCustomAttributeDefinition`. */ readonly key?: string | undefined; } /** * A discount applicable to items. */ export class CatalogDiscount { /** * The discount name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. */ name?: string | undefined; /** * Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale. * See [CatalogDiscountType](#type-catalogdiscounttype) for possible values. */ discount_type?: DiscountType | undefined; /** * The percentage of the discount as a string representation of a decimal number, using a `.` as the decimal separator and without a `%` sign. * A value of `7.5` corresponds to `7.5%`. Specify a percentage of `0` if `discount_type` is `VARIABLE_PERCENTAGE`. * Do not use this field for amount-based or variable discounts. */ percentage?: string | undefined; /** * The amount of the discount. Specify an amount of `0` if `discount_type` is `VARIABLE_AMOUNT`. * Do not use this field for percentage-based or variable discounts. */ amount_money?: Money | undefined; /** * Indicates whether a mobile staff member needs to enter their PIN to apply the discount to a payment in the Square * Point of Sale app. */ pin_required?: boolean | undefined; /** * The color of the discount display label in the Square Point of Sale app. This must be a valid hex color code. */ label_color?: string | undefined; /** * Indicates whether this discount should reduce the price used to calculate tax. * Most discounts should use `MODIFY_TAX_BASIS`. However, in some circumstances taxes must be calculated based on * an item's price, ignoring a particular discount. For example, in many US jurisdictions, a manufacturer coupon or * instant rebate reduces the price a customer pays but does not reduce the sale price used to calculate how much * sales tax is due. In this case, the discount representing that manufacturer coupon should have * `DO_NOT_MODIFY_TAX_BASIS` for this field. If you are unsure whether you need to use this field, consult your * tax professional. See [CatalogDiscountModifyTaxBasis](#type-catalogdiscountmodifytaxbasis) for possible values. */ modify_tax_basis?: string | undefined; } export class CatalogDiscountModifyTaxBasis {} /** * How to apply a CatalogDiscount to a CatalogItem. */ export class CatalogDiscountType {} /** * A mapping between a temporary client-supplied ID and a permanent server-generated ID. * When calling [UpsertCatalogObject](#endpoint-Catalog-UpsertCatalogObject) or [BatchUpsertCatalogObjects](#endpoint-Catalog-BatchUpsertCatalogObjects) * to create a [CatalogObject](#type-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 sumbitted 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 class CatalogIdMapping { /** * The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`. */ client_object_id?: string | undefined; /** * The permanent ID for the CatalogObject created by the server. */ object_id?: string | undefined; } /** * An image file to use in Square catalogs. It can be associated with catalog items, item variations, and categories. */ export class CatalogImage { /** * The internal name to identify this image in calls to the Square API. */ name?: string | undefined; /** * The URL of this image, generated by Square after an image is uploaded using the `CreateCatalogImage` endpoint. */ url?: string | undefined; /** * A caption that describes what is shown in the image. Displayed in the Square Online Store. * This is a searchable attribute for use in applicable query filters. */ caption?: string | undefined; } export class CatalogInfoRequest {} export class CatalogInfoResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * Limits that apply to this API. */ limits?: CatalogInfoResponseLimits | undefined; /** * Names and abbreviations for standard units. */ standard_unit_description_group?: StandardUnitDescriptionGroup | undefined; } export class CatalogInfoResponseLimits { /** * The maximum number of objects that may appear within a single batch in a `/v2/catalog/batch-upsert` request. */ batch_upsert_max_objects_per_batch?: number | undefined; /** * The maximum number of objects that may appear across all batches in a `/v2/catalog/batch-upsert` request. */ batch_upsert_max_total_objects?: number | undefined; /** * The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve` request. */ batch_retrieve_max_object_ids?: number | undefined; /** * The maximum number of results that may be returned in a page of a `/v2/catalog/search` response. */ search_max_page_limit?: number | undefined; /** * The maximum number of object IDs that may be included in a single `/v2/catalog/batch-delete` request. */ batch_delete_max_object_ids?: number | undefined; /** * The maximum number of item IDs that may be included in a single `/v2/catalog/update-item-taxes` request. */ update_item_taxes_max_item_ids?: number | undefined; /** * The maximum number of tax IDs to be enabled that may be included in a single `/v2/catalog/update-item-taxes` request. */ update_item_taxes_max_taxes_to_enable?: number | undefined; /** * The maximum number of tax IDs to be disabled that may be included in a single `/v2/catalog/update-item-taxes` request. */ update_item_taxes_max_taxes_to_disable?: number | undefined; /** * The maximum number of item IDs that may be included in a single `/v2/catalog/update-item-modifier-lists` request. */ update_item_modifier_lists_max_item_ids?: number | undefined; /** * The maximum number of modifier list IDs to be enabled that may be included in a single * `/v2/catalog/update-item-modifier-lists` request. */ update_item_modifier_lists_max_modifier_lists_to_enable?: number | undefined; /** * The maximum number of modifier list IDs to be disabled that may be included in a single * `/v2/catalog/update-item-modifier-lists` request. */ update_item_modifier_lists_max_modifier_lists_to_disable?: number | undefined; } /** * An [CatalogObject](#type-CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog. */ export class CatalogItem { /** * The item's name. This is a searchable attribute for use in applicable query filters, its value must not be empty, and the length is of Unicode code points. */ name?: string | undefined; /** * The item's description. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. */ description?: string | undefined; /** * The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. * This attribute is searchable, and its value length is of Unicode code points. */ abbreviation?: string | undefined; /** * The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. */ label_color?: string | undefined; /** * If `true`, the item can be added to shipping orders from the merchant's online store. */ available_online?: boolean | undefined; /** * If `true`, the item can be added to pickup orders from the merchant's online store. */ available_for_pickup?: boolean | undefined; /** * If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. */ available_electronically?: boolean | undefined; /** * The ID of the item's category, if any. */ category_id?: string | undefined; /** * A set of IDs indicating the taxes enabled for this item. When updating an item, any taxes listed here will be * added to the item. Taxes may also be added to or deleted from an item using `UpdateItemTaxes`. */ tax_ids?: string[] | undefined; /** * A set of `CatalogItemModifierListInfo` objects representing the modifier lists that apply to this item, along with * the overrides and min and max limits that are specific to this item. Modifier lists may also be added to or * deleted from an item using `UpdateItemModifierLists`. */ modifier_list_info?: CatalogItemModifierListInfo[] | undefined; /** * A list of CatalogObjects containing the `CatalogItemVariation`s for this item. */ variations?: CatalogObject[] | undefined; /** * The product type of the item. May not be changed once an item has been created. * Only items of product type `REGULAR` or `APPOINTMENTS_SERVICE` may be created by this API; items with other product * types are read-only. See [CatalogItemProductType](#type-catalogitemproducttype) for possible values */ product_type?: "REGULAR" | "GIFT_CARD" | "APPOINTMENTS_SERVICE" | "RETAIL_ITEM" | "RESTAURANT_ITEM" | undefined; /** * If `false`, the Square Point of Sale app will present the `CatalogItem`'s details screen immediately, allowing * the merchant to choose `CatalogModifier`s before adding the item to the cart. This is the default behavior. * If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre-selected modifiers, * and merchants can edit modifiers by drilling down onto the item's details. Third-party clients are encouraged to * implement similar behaviors. */ skip_modifier_screen?: boolean | undefined; /** * List of item options IDs for this item. Used to manage and group item variations in a specified order. * Maximum: 6 item options. */ item_options?: CatalogItemOptionForItem[] | undefined; } /** * Options to control the properties of a `CatalogModifierList` applied to a `CatalogItem` instance. */ export class CatalogItemModifierListInfo { /** * The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`. */ modifier_list_id: string; /** * A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is enabled by default. */ modifier_overrides?: CatalogModifierOverride[] | undefined; /** * If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`. */ min_selected_modifiers?: number | undefined; /** * If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`. */ max_selected_modifiers?: number | undefined; /** * If `true`, enable this `CatalogModifierList`. The default value is `true`. */ enabled?: boolean | undefined; } /** * A group of variations for a `CatalogItem`. */ export class CatalogItemOption { /** * The item option's display name for the seller. Must be unique across all item options. * This is a searchable attribute for use in applicable query filters. */ name?: string | undefined; /** * The item option's display name for the customer. This is a searchable attribute for use in applicable query filters. */ display_name?: string | undefined; /** * TThe item option's human-readable description. Displayed in the Square Point of Sale app for the seller and in the * Online Store or on receipts for the buyer. This is a searchable attribute for use in applicable query filters. */ description?: string | undefined; /** * If true, display colors for entries in `values` when present. */ show_colors?: boolean | undefined; /** * A list of CatalogObjects containing the `CatalogItemOptionValue`s for this item. */ values?: CatalogObject[] | undefined; } /** * 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 class CatalogItemOptionForItem { /** * The unique id of the item option, used to form the dimensions of the item option matrix in a specified order. */ item_option_id?: string | undefined; } /** * An enumerated value that can link a `CatalogItemVariation` to an item option as one of its item option values. */ export class CatalogItemOptionValue { /** * Unique ID of the associated item option. */ item_option_id?: string | undefined; /** * Name of this item option value. This is a searchable attribute for use in applicable query filters. */ name?: string | undefined; /** * A human-readable description for the option value. This is a searchable attribute for use in applicable query filters. */ description?: string | undefined; /** * The HTML-supported hex color for the item option (e.g., "#ff8d4e85"). * Only displayed if `show_colors` is enabled on the parent `ItemOption`. When left unset, `color` defaults to * white ("#ffffff") when `show_colors` is enabled on the parent `ItemOption`. */ color?: string | undefined; /** * Determines where this option value appears in a list of option values. */ ordinal?: number | undefined; } /** * 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 class CatalogItemOptionValueForItemVariation { /** * The unique id of an item option. */ item_option_id?: string | undefined; /** * The unique id of the selected value for the item option. */ item_option_value_id?: string | undefined; } /** * The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. */ export class CatalogItemProductType {} /** * An item variation (i.e., product) in the Catalog object model. Each item may have a maximum of 250 item variations. */ export class CatalogItemVariation { /** * The ID of the `CatalogItem` associated with this item variation. */ item_id?: string | undefined; /** * The item variation's name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. */ name?: string | undefined; /** * The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters. */ sku?: string | undefined; /** * The item variation's UPC, if any. This is a searchable attribute for use in applicable query filters. * It is only accessible through the Square API, and not exposed in the Square Seller Dashboard, Square Point of Sale or Retail Point of Sale apps. */ upc?: string | undefined; /** * The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal for * each item variation within a parent `CatalogItem` is set according to the item variations's position. On reads, * the value is not guaranteed to be sequential or unique. */ ordinal?: number | undefined; /** * Indicates whether the item variation's price is fixed or determined at the time of sale. * See [CatalogPricingType](#type-catalogpricingtype) for possible values. */ pricing_type?: PricingType | undefined; /** * The item variation's price, if fixed pricing is used. */ price_money?: Money | undefined; /** * Per-location price and inventory overrides. */ location_overrides?: ItemVariationLocationOverrides[] | undefined; /** * If `true`, inventory tracking is active for the variation. */ track_inventory?: boolean | undefined; /** * Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its * `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for possible values. */ inventory_alert_type?: "NONE" | "LOW_QUANTITY" | undefined; /** * If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is * `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer. */ inventory_alert_threshold?: number | undefined; /** * Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points. */ user_data?: string | undefined; /** * If the `CatalogItem` that owns this item variation is of type `APPOINTMENTS_SERVICE`, then this is the duration * of the service in milliseconds. For example, a 30 minute appointment would have the value `1800000`, which is * equal to 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second). */ service_duration?: number | undefined; /** * List of item option values associated with this item variation. Listed in the same order as the item options of the parent item. */ item_option_values?: CatalogItemOptionValueForItemVariation[] | undefined; /** * ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity sold of this item variation. * If left unset, the item will be sold in whole quantities. */ measurement_unit_id?: string | undefined; } /** * Represents the unit used to measure a `CatalogItemVariation` and specifies the precision for decimal quantities. */ export class CatalogMeasurementUnit { /** * Indicates the unit used to measure the quantity of a catalog item variation. */ measurement_unit?: MeasurementUnit | undefined; /** * An integer between 0 and 5 that represents the maximum number of positions allowed after the decimal in quantities * measured with this unit. For example: * - if the precision is 0, the quantity can be 1, 2, 3, etc. * - if the precision is 1, the quantity can be 0.1, 0.2, etc. * - if the precision is 2, the quantity can be 0.01, 0.12, etc. * Default: 3 */ precision?: number | undefined; } /** * A modifier applicable to items at the time of sale. */ export class CatalogModifier { /** * The modifier name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. */ name?: string | undefined; /** * The modifier price. */ price_money?: Money | undefined; /** * Determines where this `CatalogModifier` appears in the `CatalogModifierList`. */ ordinal?: number | undefined; /** * The ID of the `CatalogModifierList` associated with this modifier. */ modifier_list_id?: string | undefined; } /** * A list of modifiers applicable to items at the time of sale. * For example, a \"Condiments\" modifier list applicable to a \"Hot Dog\" item may contain \"Ketchup\", \"Mustard\", and \"Relish\" modifiers. * Use the `selection_type` field to specify whether or not multiple selections from the modifier list are allowed. */ export class CatalogModifierList { /** * The name for the `CatalogModifierList` instance. * This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. */ name?: string | undefined; /** * Determines where this modifier list appears in a list of `CatalogModifierList` values. */ ordinal?: number | undefined; /** * Indicates whether multiple options from the modifier list can be applied to a single `CatalogItem`. * See [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) for possible values */ selection_type?: string | undefined; /** * The options included in the `CatalogModifierList`. You must include at least one `CatalogModifier`. * Each CatalogObject must have type `MODIFIER` and contain `CatalogModifier` data. */ modifiers?: CatalogObject[] | undefined; } /** * Indicates whether a CatalogModifierList supports multiple selections. */ export class CatalogModifierListSelectionType {} /** * Options to control how to override the default behavior of the specified modifier. */ export class CatalogModifierOverride { /** * The ID of the `CatalogModifier` whose default behavior is being overridden. */ modifier_id: string; /** * If `true`, this `CatalogModifier` should be selected by default for this `CatalogItem`. */ on_by_default?: boolean | undefined; } /** * The wrapper object for the Catalog entries of a given object type. * The type of a particular `CatalogObject` is determined by the value of the `type` attribute and only the corresponding * data attribute can be set on the `CatalogObject` instance.For example, the following list shows some instances of `CatalogObject` * of a given `type` and their corresponding data atrribute that can be set: * - For a `CatalogObject` of the `ITEM` type, set the `item_data` attribute to yield the `CatalogItem` object. * - For a `CatalogObject` of the `ITEM_VARIATION` type, set the `item_variation_data` attribute to yield the `CatalogItemVariation` object. * - For a `CatalogObject` of the `MODIFIER` type, set the `modifier_data` attribute to yield the `CatalogModifier` object. * - For a `CatalogObject` of the `MODIFIER_LIST` type, set the `modifier_list_data` attribute to yield the `CatalogModifierList` object. * - For a `CatalogObject` of the `CATEGORY` type, set the `category_data` attribute to yield the `CatalogCategory` object. * - For a `CatalogObject` of the `DISCOUNT` type, set the `discount_data` attribute to yield the `CatalogDiscount` object. * - For a `CatalogObject` of the `TAX` type, set the `tax_data` attribute to yield the `CatalogTax` object. * - For a `CatalogObject` of the `IMAGE` type, set the `image_data` attribute to yield the `CatalogImageData` object. * - For a `CatalogObject` of the `QUICK_AMOUNTS_SETTINGS` type, set the `quick_amounts_settings_data` attribute to yield the `CatalogQuickAmountsSettings` object. * - For a `CatalogObject` of the `PRICING_RULE` type, set the `pricing_rule_data` attribute to yield the `CatalogPricingRule` object. * - For a `CatalogObject` of the `TIME_PERIOD` type, set the `time_period_data` attribute to yield the `CatalogTimePeriod` object. * - For a `CatalogObject` of the `PRODUCT_SET` type, set the `product_set_data` attribute to yield the `CatalogProductSet` object. * - For a `CatalogObject` of the `SUBSCRIPTION_PLAN` type, set the `subscription_plan_data` attribute to yield the `CatalogSubscriptionPlan` object. * For a more detailed discussion of the Catalog data model, please see the [Design a Catalog](/catalog-api/design-a-catalog) guide. */ export class CatalogObject { /** * The type of this object. Each object type has expected properties expressed in a structured format within its * corresponding `*_data` field below. See [CatalogObjectType](#type-catalogobjecttype) for possible values. */ type: ObjectType; /** * An identifier to reference this object in the catalog. When a new `CatalogObject` is inserted, the client should * set the id to a temporary identifier starting with a `#` character. Other objects being inserted or updated * within the same request may use this identifier to refer to the new object. When the server receives the new object, * it will supply a unique identifier that replaces the temporary identifier for all future references. */ id: string; /** * Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, * e.g., "2016-08-15T23:59:33.123Z" would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. */ updated_at?: string | undefined; /** * The version of the object. When updating an object, the version supplied must match the version in the database, * otherwise the write will be rejected as conflicting. */ version?: number | undefined; /** * If `true`, the object has been deleted from the database. Must be `false` for new objects being inserted. When * deleted, the `updated_at` field will equal the deletion time. */ is_deleted?: boolean | undefined; /** * A map (key-value pairs) of application-defined custom attribute values. * The value of a key-value pair is a `CatalogCustomAttributeValue` object. * The key is the `key` attribute value defined in the associated `CatalogCustomAttributeDefinition` object defined by the application making the request. * If the `CatalogCustomAttributeDefinition` object is defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by the defining application ID. * For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of `\"cocoa_brand\"` and the defining * application ID is `\"abcd1234\"`, the key in the map is `\"abcd1234:cocoa_brand\"` if the application making the * request is different from the application defining the custom attribute definition. * Otherwise, the key used in the map is simply `\"cocoa_brand\"`. Application-defined custom attributes that are set at a global (location-independent) level. * Custom attribute values are intended to store additional information about a catalog object or associations with * an entity in another system. Do not use custom attributes to store any sensitive information (personally identifiable information, card details, etc.). */ custom_attribute_values?: Record | undefined; /** * The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. * The field will only be present for objects that have been created or modified by legacy APIs. */ catalog_v1_ids?: Array> | undefined; /** * If `true`, this object is present at all locations (including future locations), except where specified in the * `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future * locations), except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. */ present_at_all_locations?: boolean | undefined; /** * A list of locations where the object is present, even if `present_at_all_locations` is `false`. */ present_at_location_ids?: string[] | undefined; /** * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. */ absent_at_location_ids?: string[] | undefined; /** * Identifies the `CatalogImage` attached to this `CatalogObject`. */ image_id?: string | undefined; /** * Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`. */ item_data?: CatalogItem | undefined; /** * Structured data for a `CatalogCategory`, set for CatalogObjects of type `CATEGORY`. */ category_data?: CatalogCategory | undefined; /** * Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`. */ item_variation_data?: CatalogItemVariation | undefined; /** * Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`. */ tax_data?: CatalogTax | undefined; /** * Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`. */ discount_data?: CatalogDiscount | undefined; /** * Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`. */ modifier_list_data?: CatalogModifierList | undefined; /** * Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`. */ modifier_data?: CatalogModifier | undefined; /** * Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`. */ time_period_data?: CatalogTimePeriod | undefined; /** * Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`. */ product_set_data?: CatalogProductSet | undefined; /** * Structured data for a `CatalogPricingRule`, set for CatalogObjects of type `PRICING_RULE`. * A `CatalogPricingRule` object often works with a `CatalogProductSet` object or a `CatalogTimePeriod` object. */ pricing_rule_data?: CatalogPricingRule | undefined; /** * Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. */ image_data?: CatalogImage | undefined; /** * Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`. */ measurement_unit_data?: CatalogMeasurementUnit | undefined; /** * Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`. */ subscription_plan_data?: CatalogSubscriptionPlan | undefined; /** * Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`. */ item_option_data?: CatalogItemOption | undefined; /** * Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`. */ item_option_value_data?: CatalogItemOptionValue | undefined; /** * Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. */ custom_attribute_definition_data?: CatalogCustomAttributeDefinition | undefined; /** * Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. */ quick_amounts_settings_data?: CatalogQuickAmountsSettings | undefined; } /** * A batch of catalog objects. */ export class CatalogObjectBatch { /** * A list of CatalogObjects belonging to this batch. */ objects: CatalogObject[]; } /** * Possible types of CatalogObjects returned from the Catalog, each containing type-specific properties in the * `*_data` field corresponding to the object type. */ export class CatalogObjectType {} /** * Defines how discounts are automatically applied to a set of items that match the pricing rule during the active time period. */ export class CatalogPricingRule { /** * User-defined name for the pricing rule. For example, "Buy one get one free" or "10% off". */ name?: string | undefined; /** * A list of unique IDs for the catalog time periods when this pricing rule is in effect. * If left unset, the pricing rule is always in effect. */ time_period_ids?: string[] | undefined; /** * Unique ID for the `CatalogDiscount` to take off the price of all matched items. */ discount_id?: string | undefined; /** * Unique ID for the `CatalogProductSet` that will be matched by this rule. * A match rule matches within the entire cart, and can match multiple times. This field will always be set. */ match_products_id?: string | undefined; /** * @deprecated Please use the `exclude_products_id` field to apply an exclude set instead. * Exclude sets allow better control over quantity ranges and offer more flexibility for which matched items receive a discount. * `CatalogProductSet` to apply the pricing to. An apply rule matches within the subset of the cart that fits the match * rules (the match set). An apply rule can only match once in the match set. If not supplied, the pricing will be * applied to all products in the match set. Other products retain their base price, or a price generated by other rules. */ apply_products_id?: string | undefined; /** * `CatalogProductSet` to exclude from the pricing rule. An exclude rule matches within the subset of the cart that * fits the match rules (the match set). An exclude rule can only match once in the match set. If not supplied, * the pricing will be applied to all products in the match set. Other products retain their base price, or * a price generated by other rules. */ exclude_products_id?: string | undefined; /** * Represents the date the Pricing Rule is valid from. Represented in RFC3339 full-date format (YYYY-MM-DD). */ valid_from_date?: string | undefined; /** * Represents the local time the pricing rule should be valid from. Represented in RFC3339 partial-time format (HH:MM:SS). * Partial seconds will be truncated. */ valid_from_local_time?: string | undefined; /** * Represents the date the Pricing Rule is valid until. Represented in RFC3339 full-date format (YYYY-MM-DD). */ valid_until_date?: string | undefined; /** * Represents the local time the pricing rule should be valid until. * Represented in RFC3339 partial-time format (HH:MM:SS). Partial seconds will be truncated. */ valid_until_local_time?: string | undefined; /** * If an `exclude_products_id` was given, controls which subset of matched products is excluded from any discounts. * Default value: `LEAST_EXPENSIVE` See [ExcludeStrategy](#type-excludestrategy) for possible values. */ exclude_strategy?: string | undefined; } /** * Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. */ export class CatalogPricingType {} /** * 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 class CatalogProductSet { /** * User-defined name for the product set. For example, "Clearance Items" or "Winter Sale Items". */ name?: string | undefined; /** * Unique IDs for any `CatalogObject` included in this product set. Any number of these catalog objects can be in * an order for a pricing rule to apply. This can be used with `product_ids_all` in a parent `CatalogProductSet` * to match groups of products for a bulk discount, such as a discount for an entree and side combo. * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. Max: 500 catalog object IDs. */ product_ids_any?: string[] | undefined; /** * Unique IDs for any `CatalogObject` included in this product set. All objects in this set must be included in an * order for a pricing rule to apply. Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. * Max: 500 catalog object IDs. */ product_ids_all?: string[] | undefined; /** * If set, there must be exactly this many items from `products_any` or `products_all` in the cart for the discount to apply. * Cannot be combined with either `quantity_min` or `quantity_max`. */ quantity_exact?: number | undefined; /** * If set, there must be at least this many items from `products_any` or `products_all` in a cart for the discount to apply. * See `quantity_exact`. Defaults to 0 if `quantity_exact`, `quantity_min` and `quantity_max` are all unspecified. */ quantity_min?: number | undefined; /** * If set, the pricing rule will apply to a maximum of this many items from `products_any` or `products_all`. */ quantity_max?: number | undefined; /** * If set to `true`, the product set will include every item in the catalog. * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. */ all_products?: boolean | undefined; } /** * 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 one query is allowed per call to [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects). * 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`, `CatelogCatogry`, `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](#type-CatalogItem) objects by searchable attributes, * you can use the `\"name\"`, `\"description\"`, or `\"abbreviation\"` attribute in an applicable query filter. */ export class CatalogQuery { /** * A query expression to sort returned query result by the given attribute. */ sorted_attribute_query?: CatalogQuerySortedAttribute | undefined; /** * An exact query expression to return objects with attribute name and value matching the specified attribute name and value exactly. * Value matching is case insensitive. */ exact_query?: CatalogQueryExact | undefined; /** * A set query expression to return objects with attribute name and value matching the specified attribute name * and any of the specified attribute values exactly. Value matching is case insensitive. */ set_query?: CatalogQuerySet | undefined; /** * A prefix query expression to return objects with attribute values that have a prefix matching the specified string value. * Value matching is case insensitive. */ prefix_query?: CatalogQueryPrefix | undefined; /** * A range query expression to return objects with numeric values that lie in the specified range. */ range_query?: CatalogQueryRange | undefined; /** * A text query expression to return object whose searchable attributes contain all of the given keywords, * irrespective of their order. For example, if a `CatalogItem` contains custom attribute values of * `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Purple\"}`, the query filter of * `{\"keywords\": [\"shirt\", \"sma\", \"purp\"]}` returns this item. */ text_query?: CatalogQueryText | undefined; /** * A query expression to return items that have any of the specified taxes (as identified by the corresponding `CatalogTax` object IDs) enabled. */ items_for_tax_query?: CatalogQueryItemsForTax | undefined; /** * A query expression to return items that have any of the given modifier list (as identified by the corresponding `CatalogModifierList`s IDs) enabled. */ items_for_modifier_list_query?: CatalogQueryItemsForModifierList | undefined; /** * A query expression to return items that contains the specified item options (as identified the corresponding `CatalogItemOption` IDs). */ items_for_item_options_query?: CatalogQueryItemsForItemOptions | undefined; /** * A query expression to return item variations (of the `CatalogItemVariation` that contain all of the specified `CatalogItemOption` IDs. */ item_variations_for_item_option_values_query?: CatalogQueryItemVariationsForItemOptionValues | undefined; } export class CatalogQueryCustomAttributeUsage { custom_attribute_definition_ids?: string[] | undefined; has_value?: boolean | undefined; } /** * The query filter to return the search result by exact match of the specified attribute name and value. */ export class CatalogQueryExact { /** * The name of the attribute to be searched. Matching of the attribute name is exact. */ attribute_name: string; /** * The desired value of the search attribute. Matching of the attribute value is case insensitive and can be partial. * For example, if a specified value of \"sma\", objects with the named attribute value of \"Small\", \"small\" are both matched. */ attribute_value: string; } /** * The query filter to return the item variations containing the specified item option value IDs. */ export class CatalogQueryItemVariationsForItemOptionValues { /** * A set of `CatalogItemOptionValue` IDs to be used to find associated `CatalogItemVariation`s. * All ItemVariations that contain all of the given Item Option Values (in any order) will be returned. */ item_option_value_ids?: string[] | undefined; } /** * The query filter to return the items containing the specified item option IDs. */ export class CatalogQueryItemsForItemOptions { /** * A set of `CatalogItemOption` IDs to be used to find associated `CatalogItem`s. * All Items that contain all of the given Item Options (in any order) will be returned. */ item_option_ids?: string[] | undefined; } /** * The query filter to return the items containing the specified modifier list IDs. */ export class CatalogQueryItemsForModifierList { /** * A set of `CatalogModifierList` IDs to be used to find associated `CatalogItem`s. */ modifier_list_ids: string[]; } /** * The query filter to return the items containing the specified tax IDs. */ export class CatalogQueryItemsForTax { /** * A set of `CatalogTax` IDs to be used to find associated `CatalogItem`s. */ tax_ids: string[]; } /** * The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. */ export class CatalogQueryPrefix { /** * The name of the attribute to be searched. */ attribute_name: string; /** * The desired prefix of the search attribute value. */ attribute_prefix: string; } /** * The query filter to return the search result whose named attribute values fall between the specified range. */ export class CatalogQueryRange { /** * The name of the attribute to be searched. */ attribute_name: string; /** * The desired minimum value for the search attribute (inclusive). */ attribute_min_value?: number | undefined; /** * The desired maximum value for the search attribute (inclusive). */ attribute_max_value?: number | undefined; } /** * The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of the `attribute_values`. */ export class CatalogQuerySet { /** * The name of the attribute to be searched. Matching of the attribute name is exact. */ attribute_name: string; /** * The desired values of the search attribute. Matching of the attribute values is exact and case insensitive. * A maximum of 250 values may be searched in a request. */ attribute_values: string[]; } /** * The query expression to specify the key to sort search results. */ export class CatalogQuerySortedAttribute { /** * The attribute whose value is used as the sort key. */ attribute_name: string; /** * The first attribute value to be returned by the query. Ascending sorts will return only objects with this value * or greater, while descending sorts will return only objects with this value or less. * If unset, start at the beginning (for ascending sorts) or end (for descending sorts). */ initial_attribute_value?: string | undefined; /** * The desired sort order, "ASC" (ascending) or "DESC" (descending). See [SortOrder](#type-sortorder) for possible values. */ sort_order?: SortOrderType | undefined; } /** * 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 class CatalogQueryText { /** * A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 characters are ignored. */ keywords: string[]; } /** * Represents a Quick Amount in the Catalog. */ export class CatalogQuickAmount { /** * Represents the type of the Quick Amount. See [CatalogQuickAmountType](#type-catalogquickamounttype) for possible values. */ type: string; /** * Represents the actual amount of the Quick Amount with Money type. */ amount: Money; /** * Describes the ranking of the Quick Amount provided by machine learning model, in the range [0, 100]. * MANUAL type amount will always have score = 100. */ score?: number | undefined; /** * The order in which this Quick Amount should be displayed. */ ordinal?: number | undefined; } /** * Determines the type of a specific Quick Amount. */ export class CatalogQuickAmountType {} /** * A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. */ export class CatalogQuickAmountsSettings { /** * Represents the option seller currently uses on Quick Amounts. * See [CatalogQuickAmountsSettingsOption](#type-catalogquickamountssettingsoption) for possible values */ option: string; /** * Represents location's eligibility for auto amounts The boolean should be consistent with whether there are AUTO amounts in the `amounts`. */ eligible_for_auto_amounts?: boolean | undefined; /** * Represents a set of Quick Amounts at this location. */ amounts?: CatalogQuickAmount[] | undefined; } /** * Determines a seller's option on Quick Amounts feature. */ export class CatalogQuickAmountsSettingsOption {} /** * Describes a subscription plan. For more information, see [Set Up and Manage a Subscription Plan](/docs/subscriptions-api/setup-plan). */ export class CatalogSubscriptionPlan { /** * The name of the plan. */ name?: string | undefined; /** * A list of SubscriptionPhase containing the `SubscriptionPhase` for this plan. */ phases?: SubscriptionPhase[] | undefined; } /** * A tax applicable to an item. */ export class CatalogTax { /** * The tax's name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. */ name?: string | undefined; /** * Whether the tax is calculated based on a payment's subtotal or total. * See [TaxCalculationPhase](#type-taxcalculationphase) for possible values. */ calculation_phase?: "TAX_SUBTOTAL_PHASE" | "TAX_TOTAL_PHASE" | undefined; /** * Whether the tax is `ADDITIVE` or `INCLUSIVE`. See [TaxInclusionType](#type-taxinclusiontype) for possible values. */ inclusion_type?: TaxType | undefined; /** * The percentage of the tax in decimal form, using a '.' as the decimal separator and without a '%' sign. * A value of `7.5` corresponds to 7.5%. */ percentage?: string | undefined; /** * If `true`, the fee applies to custom amounts entered into the Square Point of Sale app that are not associated * with a particular `CatalogItem`. */ applies_to_custom_amounts?: boolean | undefined; /** * A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of Sale app or not (`false`). */ enabled?: boolean | undefined; } /** * Represents a time period - either a single period or a repeating period. */ export class CatalogTimePeriod { /** * An iCalendar (RFC5545) [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which specifies the name, * timing, duration and recurrence of this time period. * Example: `DTSTART:20190707T180000 DURATION:P2H RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR` * Only `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are supported. * `DTSTART` must be in local (unzoned) time format. Note that while `BEGIN:VEVENT` and `END:VEVENT` * is not required in the request. The response will always include them. */ event?: string | undefined; } /** * @deprecated recommend using [CreatePayment](#endpoint-payments-createpayment) * Defines the parameters that can be included in the body of a request to the [Charge](#endpoint-charge) endpoint. */ export class ChargeRequest { /** * A value you specify that uniquely identifies this transaction among transactions you've created. * If you're unsure whether a particular transaction succeeded, you can reattempt it with the same idempotency key * without worrying about double-charging the buyer. See [Idempotency keys](#idempotencykeys) for more information. */ idempotency_key: string; /** * The amount of money to charge. Note that you specify the amount in the __smallest denomination of the applicable currency__. * For example, US dollar amounts are specified in cents. * See [Working with monetary amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) for details. * The value of `currency` must match the currency associated with the business that is charging the card. */ amount_money: Money; /** * A nonce generated from the `SqPaymentForm` that represents the card to charge. The application that provides a * nonce to this endpoint must be the _same application_ that generated the nonce with the `SqPaymentForm`. * Otherwise, the nonce is invalid. Do not provide a value for this field if you provide a value for `customer_card_id`. */ card_nonce?: string | undefined; /** * The ID of the customer card on file to charge. Do not provide a value for this field if you provide a value for `card_nonce`. * If you provide this value, you _must_ also provide a value for `customer_id`. */ customer_card_id?: string | undefined; /** * If `true`, the request will only perform an Auth on the provided card. You can then later perform either a * Capture (with the `CaptureTransaction` or a Void (with the `VoidTransaction`. Default value: `false` */ delay_capture?: boolean | undefined; /** * An optional ID you can associate with the transaction for your own purposes (such as to associate the transaction * with an entity ID in your own database). This value cannot exceed 40 characters. */ reference_id?: string | undefined; /** * An optional note to associate with the transaction. This value cannot exceed 60 characters. */ note?: string | undefined; /** * The ID of the customer to associate this transaction with. * This field is required if you provide a value for `customer_card_id`, and optional otherwise. */ customer_id?: string | undefined; /** * The buyer's billing address. This value is optional, but this transaction is ineligible for chargeback protection * if neither this parameter nor `shipping_address` is provided. */ billing_address?: Address | undefined; /** * The buyer's shipping address, if available. This value is optional, but this transaction is ineligible for * chargeback protection if neither this parameter nor `billing_address` is provided. */ shipping_address?: Address | undefined; /** * The buyer's email address, if available. * This value is optional, but this transaction is ineligible for chargeback protection if it is not provided. */ buyer_email_address?: string | undefined; /** * The ID of the order to associate with this transaction. If you provide this value, the `amount_money` value of * your request must __exactly match__ the value of the order's `total_money` field. */ order_id?: string | undefined; /** * The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be * split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be * more than 90% of the `amount_money` value in the charge request. The `location_id` must be the valid location of * the app owner merchant. This field requires the `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. * This field is currently not supported in sandbox. */ additional_recipients?: AdditionalRecipient[] | undefined; /** * A token generated by SqPaymentForm's verifyBuyer() that represents customer's device info and 3ds challenge result. */ verification_token?: string | undefined; } /** * 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 class ChargeRequestAdditionalRecipient { /** * The location ID for a recipient (other than the merchant) receiving a portion of the tender. */ location_id: string; /** * The description of the additional recipient. */ description: string; /** * The amount of money distributed to the recipient. */ amount_money: Money; } /** * Defines the fields that are included in the response body of a request to the [Charge](#endpoint-charge) endpoint. * One of `errors` or `transaction` is present in a given response (never both). */ export class ChargeResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The created transaction. */ transaction?: Transaction | undefined; } /** * Square Checkout lets merchants accept online payments for supported payment types using a checkout workflow hosted on squareup.com. */ export class Checkout { /** * ID generated by Square Checkout when a new checkout is requested. */ id?: string | undefined; /** * The URL that the buyer's browser should be redirected to after the checkout is completed. */ checkout_page_url?: string | undefined; /** * If `true`, Square Checkout will collect shipping information on your behalf and store that information with the * transaction information in your Square Dashboard. Default: `false`. */ ask_for_shipping_address?: boolean | undefined; /** * The email address to display on the Square Checkout confirmation page and confirmation email that the buyer can * use to contact the merchant. If this value is not set, the confirmation page and email will display the primary * email address associated with the merchant's Square account. Default: none; only exists if explicitly set. */ merchant_support_email?: string | undefined; /** * If provided, the buyer's email is pre-populated on the checkout page as an editable text field. * Default: none; only exists if explicitly set. */ pre_populate_buyer_email?: string | undefined; /** * If provided, the buyer's shipping info is pre-populated on the checkout page as editable text fields. * Default: none; only exists if explicitly set. */ pre_populate_shipping_address?: Address | undefined; /** * The URL to redirect to after checkout is completed with `checkoutId`, Square's `orderId`, `transactionId`, and * `referenceId` appended as URL parameters. For example, if the provided redirect_url is * `http://www.example.com/order-complete`, a successful transaction redirects the customer to: * `http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx` * If you do not provide a redirect URL, Square Checkout will display an order confirmation page on your behalf; * however Square strongly recommends that you provide a redirect URL so you can verify the transaction results and * finalize the order through your existing/normal confirmation workflow. */ redirect_url?: string | undefined; /** * Order to be checked out. */ order?: Order | undefined; /** * The time when the checkout was created, in RFC 3339 format. */ created_at?: string | undefined; /** * Additional recipients (other than the merchant) receiving a portion of this checkout. For example, fees assessed * on the purchase by a third party integration. */ additional_recipients?: AdditionalRecipient[] | undefined; } /** * Completes (captures) a payment. By default, payments are set to `autocomplete` immediately after they are created. * To complete payments manually, set `autocomplete` to `false`. */ export class CompletePaymentRequest {} /** * The return value from a [CompletePayment](#endpoint-payments-completepayment) call. */ export class CompletePaymentResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The successfully completed payment. */ payment?: Payment | undefined; } /** * Latitude and longitude coordinates. */ export class Coordinates { /** * The latitude of the coordinate expressed in degrees. */ latitude?: number | undefined; /** * The longitude of the coordinate expressed in degrees. */ longitude?: number | undefined; } /** * 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 class Country {} /** * A request to create a new `BreakType`. */ export class CreateBreakTypeRequest { /** * Unique string value to insure idempotency of the operation. */ idempotency_key?: string | undefined; /** * The `BreakType` to be created. */ break_type: BreakType; } /** * The response to the request to create a `BreakType`. Contains the created `BreakType` object. * May contain a set of `Error` objects if the request resulted in errors. */ export class CreateBreakTypeResponse { /** * The `BreakType` that was created by the request. */ break_type?: BreakType | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class CreateCatalogImageRequest { /** * A unique string that identifies this CreateCatalogImage request. * Keys can be any valid string but must be unique for every CreateCatalogImage request. * See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ idempotency_key: string; /** * Unique ID of the `CatalogObject` to attach to this `CatalogImage`. Leave this field empty to create unattached images, * for example if you are building an integration where these images can be attached to catalog items at a later time. */ object_id?: string | undefined; /** * The new `IMAGE`-type `CatalogObject` to be attached to this `CatalogImage`. * If the `CatalogObject` already has a `CatalogImage`, this call will overwrite it. */ image?: CatalogObject | undefined; } export class CreateCatalogImageResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The newly created `CatalogImage` including a Square-generated URL for each image. */ image?: CatalogObject | undefined; } /** * Defines the parameters that can be included in the body of a request to the __CreateCheckout__ endpoint. */ export class CreateCheckoutRequest { /** * A unique string that identifies this checkout among others you've created. It can be any valid string but must be * unique for every order sent to Square Checkout for a given location ID. The idempotency key is used to avoid processing * the same order more than once. If you're unsure whether a particular checkout was created successfully, * you can reattempt it with the same idempotency key and all the same other parameters without worrying about creating duplicates. * We recommend using a random number/string generator native to the language you are working in to generate * strings for your idempotency keys. * See the [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency) guide for more information. */ idempotency_key: string; /** * The order including line items to be checked out. */ order: CreateOrderRequest; /** * If `true`, Square Checkout will collect shipping information on your behalf and store that information with the * transaction information in your Square Dashboard. Default: `false`. */ ask_for_shipping_address?: boolean | undefined; /** * The email address to display on the Square Checkout confirmation page and confirmation email that the buyer can * use to contact the merchant. If this value is not set, the confirmation page and email will display the primary * email address associated with the merchant's Square account. Default: none; only exists if explicitly set. */ merchant_support_email?: string | undefined; /** * If provided, the buyer's email is pre-populated on the checkout page as an editable text field. * Default: none; only exists if explicitly set. */ pre_populate_buyer_email?: string | undefined; /** * If provided, the buyer's shipping info is pre-populated on the checkout page as editable text fields. * Default: none; only exists if explicitly set. */ pre_populate_shipping_address?: Address | undefined; /** * The URL to redirect to after checkout is completed with `checkoutId`, Square's `orderId`, `transactionId`, and * `referenceId` appended as URL parameters. For example, if the provided redirect_url is * `http://www.example.com/order-complete`, a successful transaction redirects the customer to: * `http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx` * If you do not provide a redirect URL, Square Checkout will display an order confirmation page on your behalf; * however Square strongly recommends that you provide a redirect URL so you can verify the transaction results and * finalize the order through your existing/normal confirmation workflow. * Default: none; only exists if explicitly set. */ redirect_url?: string | undefined; /** * The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be * split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be * more than 90% of the `total_money` calculated by Square for your order. The `location_id` must be the valid * location of the app owner merchant. This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. * This field is currently not supported in sandbox. */ additional_recipients?: ChargeRequestAdditionalRecipient[] | undefined; /** * An optional note to associate with the checkout object. This value cannot exceed 60 characters. */ note?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the __CreateCheckout__ endpoint. */ export class CreateCheckoutResponse { /** * The newly created checkout. * If the same request was made with the same idempotency_key, this will be the checkout created with the idempotency_key. */ checkout?: Checkout | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines the fields that are included in the request body of a request to the CreateCustomerCard endpoint. */ export class CreateCustomerCardRequest { /** * A card nonce representing the credit card to link to the customer. * Card nonces are generated by the Square Payment Form when customers enter their card information. * See [Embedding the payment form](https://developer.squareup.com/docs/payment-form/payment-form-walkthrough) for more information. * @note Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card. */ card_nonce: string; /** * Address information for the card on file. Only the `postal_code` field is required for payments in the US and Canada. */ billing_address?: Address | undefined; /** * The full name printed on the credit card. */ cardholder_name?: string | undefined; /** * An identifying token generated by `SqPaymentForm.verifyBuyer()`. Verification tokens encapsulate customer device * information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. */ verification_token?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the CreateCustomerCard endpoint. * One of `errors` or `card` is present in a given response (never both). */ export class CreateCustomerCardResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The created card on file. */ card?: Card | undefined; } /** * Defines the body parameters that can be provided in a request to the [CreateCustomerGroup](#endpoint-createcustomegroup) endpoint. */ export class CreateCustomerGroupRequest { /** * The idempotency key for the request. * See the [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) guide for more information. */ idempotency_key?: string | undefined; /** * The customer group to create. */ group: CustomerGroup; } /** * Defines the fields that are included in the response body of a request to the [CreateCustomerGroup](#endpoint-createcustomergroup) endpoint. * One of `errors` or `group` is present in a given response (never both). */ export class CreateCustomerGroupResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The successfully created customer group. */ group?: CustomerGroup | undefined; } /** * Defines the body parameters that can be provided in a request to the CreateCustomer endpoint. */ export class CreateCustomerRequest { /** * The idempotency key for the request. * See the [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency) guide for more information. */ idempotency_key?: string | undefined; /** * The given (i.e., first) name associated with the customer profile. */ given_name?: string | undefined; /** * The family (i.e., last) name associated with the customer profile. */ family_name?: string | undefined; /** * A business name associated with the customer profile. */ company_name?: string | undefined; /** * A nickname for the customer profile. */ nickname?: string | undefined; /** * The email address associated with the customer profile. */ email_address?: string | undefined; /** * The physical address associated with the customer profile. */ address?: Address | undefined; /** * The 11-digit phone number associated with the customer profile. */ phone_number?: string | undefined; /** * An optional, second ID used to associate the customer profile with an entity in another system. */ reference_id?: string | undefined; /** * A custom note associated with the customer profile. */ note?: string | undefined; /** * The birthday associated with the customer profile, in RFC 3339 format. Year is optional, timezone and times are not allowed. * For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st. * `1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. */ birthday?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the CreateCustomer endpoint. * One of `errors` or `customer` is present in a given response (never both). */ export class CreateCustomerResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The created customer. */ customer?: Customer | undefined; } export class CreateDeviceCodeRequest { /** * A unique string that identifies this CreateCheckout request. Keys can be any valid string but must be unique for every CreateCheckout request. * See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ idempotency_key: string; /** * The device code to create. */ device_code: DeviceCode; } export class CreateDeviceCodeResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The created DeviceCode object containing the device code string. */ device_code?: DeviceCode | undefined; } /** * Defines parameters for a CreateDisputeEvidenceFile request. */ export class CreateDisputeEvidenceFileRequest { /** * Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/docs/working-with-apis/idempotency). */ idempotency_key: string; /** * The type of evidence you are uploading. See [DisputeEvidenceType](#type-disputeevidencetype) for possible values */ evidence_type?: string | undefined; /** * The MIME type of the uploaded file. One of image/heic, image/heif, image/jpeg, application/pdf, image/png, image/tiff. */ content_type?: string | undefined; } /** * Defines fields in a CreateDisputeEvidenceFile response. */ export class CreateDisputeEvidenceFileResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The metadata of the newly uploaded dispute evidence. */ evidence?: DisputeEvidence | undefined; } /** * Defines parameters for a CreateDisputeEvidenceText request. */ export class CreateDisputeEvidenceTextRequest { /** * Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/docs/working-with-apis/idempotency). */ idempotency_key: string; /** * The type of evidence you are uploading. See [DisputeEvidenceType](#type-disputeevidencetype) for possible values. */ evidence_type?: string | undefined; /** * The evidence string. */ evidence_text: string; } /** * Defines fields in a CreateDisputeEvidenceText response. */ export class CreateDisputeEvidenceTextResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The newly uploaded dispute evidence metadata. */ evidence?: DisputeEvidence | undefined; } /** * Describes a `CreateInvoice` request. */ export class CreateInvoiceRequest { /** * The invoice to create. */ invoice: Invoice; /** * A unique string that identifies the `CreateInvoice` request. * If you do not provide `idempotency_key` (or provide an empty string as the value), the endpoint treats each request as independent. * For more information, see [Idempotency](https://developer.squareup.com/docs/docs/working-with-apis/idempotency). */ idempotency_key?: string | undefined; } /** * The response returned by the `CreateInvoice` request. */ export class CreateInvoiceResponse { /** * The newly created invoice. */ invoice?: Invoice | undefined; /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; } /** * Request object for the [CreateLocation](#endpoint-createlocation) endpoint. */ export class CreateLocationRequest { /** * The initial values of the location being created. The `name` field is required. All other fields are optional. * Unspecified fields will be set to default values using existing location data. */ location?: Location | undefined; } /** * Response object returned by the [CreateLocation](#endpoint-createlocation) endpoint. */ export class CreateLocationResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The newly created `Location`. */ location?: Location | undefined; } /** * A request to create a new loyalty account. */ export class CreateLoyaltyAccountRequest { /** * The loyalty account to create. */ loyalty_account: LoyaltyAccount; /** * A unique string that identifies this `CreateLoyaltyAccount` request. Keys can be any valid string, but must be unique for every request. */ idempotency_key: string; } /** * A response that includes loyalty account created. */ export class CreateLoyaltyAccountResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The newly created loyalty account. */ loyalty_account?: LoyaltyAccount | undefined; } /** * A request to create a loyalty reward. */ export class CreateLoyaltyRewardRequest { /** * The reward to create. */ reward: LoyaltyReward; /** * A unique string that identifies this `CreateLoyaltyReward` request. Keys can be any valid string, but must be unique for every request. */ idempotency_key: string; } /** * A response that includes the loyalty reward created. */ export class CreateLoyaltyRewardResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The loyalty reward created. */ reward?: LoyaltyReward | undefined; } /** * Defines the body parameters that can be provided in a request to the __CreateMobileAuthorizationCode__ endpoint. */ export class CreateMobileAuthorizationCodeRequest { /** * The Square location ID the authorization code should be tied to. */ location_id?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the __CreateMobileAuthorizationCode__ endpoint. */ export class CreateMobileAuthorizationCodeResponse { /** * Generated authorization code that connects a mobile application instance to a Square account. */ authorization_code?: string | undefined; /** * The timestamp when `authorization_code` expires in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, * e.g., "2016-09-04T23:59:33.123Z". */ expires_at?: string | undefined; /** * An error object that provides details about how creation of authorization code failed. */ error?: Error | undefined; } export class CreateOrderRequest { /** * The order to create. If this field is set, then the only other top-level field that can be set is the idempotency_key. */ order?: Order | undefined; /** * The ID of the business location to associate the order with. */ location_id?: string | undefined; /** * A value you specify that uniquely identifies this order among orders you've created. * If you're unsure whether a particular order was created successfully, you can reattempt it with the same idempotency * key without worrying about creating duplicate orders. * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ idempotency_key?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the CreateOrder endpoint. * One of `errors` or `order` is present in a given response (never both). */ export class CreateOrderResponse { /** * The newly created order. */ order?: Order | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Creates a payment from a provided source (such as a nonce or a card on file). * The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required to enable application fees. * For more information, see [Payments and Refunds APIs Overview](/payments-api/overview). * For information about application fees in a payment, see [Take Payments and Collect Fees](/payments-api/take-payments-and-collect-fees). */ export class CreatePaymentRequest { /** * The ID for the source of funds for this payment. * This can be a nonce generated by the Square payment form or a card on file made with the Customers API. */ source_id: string; /** * A unique string that identifies this `CreatePayment` request. * Keys can be any valid string but must be unique for every `CreatePayment` request. * Max: 45 characters Note: The number of allowed characters might be less than the stated maximum, if multi-byte characters are used. * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). */ idempotency_key: string; /** * The amount of money to accept for this payment, not including `tip_money`. * The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). * For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). * The currency code must match the currency associated with the business that is accepting the payment. */ amount_money: Money; /** * The amount designated as a tip, in addition to `amount_money`. * The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). * For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). * The currency code must match the currency associated with the business that is accepting the payment. */ tip_money?: Money | undefined; /** * The amount of money that the developer is taking as a fee for facilitating the payment on behalf of the seller. * The amount cannot be more than 90% of the total amount of the payment. * The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). * For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). * The fee currency code must match the currency associated with the seller that is accepting the payment. * The application must be from a developer account in the same country and using the same currency code as the seller. * For more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). */ app_fee_money?: Money | undefined; /** * The duration of time after the payment's creation when Square automatically cancels the payment. * This automatic cancellation applies only to payments that do not reach a terminal state (COMPLETED, CANCELED, or FAILED) * before the `delay_duration` time period. This parameter should be specified as a time duration, in RFC 3339 format, * with a minimum value of 1 minute. * @note This feature is only supported for card payments. This parameter can only be set for a delayed capture payment (`autocomplete=false`). Default: * - Card-present payments: \"PT36H\" (36 hours) from the creation time. * - Card-not-present payments: \"P7D\" (7 days) from the creation time. */ delay_duration?: string | undefined; /** * If set to `true`, this payment will be completed when possible. * If set to `false`, this payment is held in an approved state until either explicitly completed (captured) or canceled (voided). * For more information, see [Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). * Default: true. */ autocomplete?: boolean | undefined; /** * Associates a previously created order with this payment. */ order_id?: string | undefined; /** * The `Customer` ID of the customer associated with the payment. * This is required if the `source_id` refers to a card on file created using the Customers API. */ customer_id?: string | undefined; /** * The location ID to associate with the payment. If not specified, the default location is used. */ location_id?: string | undefined; /** * A user-defined ID to associate with the payment. * You can use this field to associate the payment to an entity in an external system * (for example, you might specify an order ID that is generated by a third-party shopping cart). Limit 40 characters. */ reference_id?: string | undefined; /** * An identifying token generated by `SqPaymentForm.verifyBuyer()`. * Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate * that Square has verified the buyer identity. For more information, see [SCA Overview](https://developer.squareup.com/docs/sca-overview). */ verification_token?: string | undefined; /** * If set to `true` and charging a Square Gift Card, a payment might be returned with `amount_money` equal to less than what was requested. * For example, a request for $20 when charging a Square Gift Card with a balance of $5 results in an APPROVED payment of $5. * You might choose to prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card payment. * This field cannot be `true` when `autocomplete = true`. * For more information, see [Partial amount with Square Gift Cards](https://developer.squareup.com/docs/payments-api/take-payments#partial-payment-gift-card). * Default: false. */ accept_partial_authorization?: boolean | undefined; /** * The buyer's email address. */ buyer_email_address?: string | undefined; /** * The buyer's billing address. */ billing_address?: Address | undefined; /** * The buyer's shipping address. */ shipping_address?: Address | undefined; /** * An optional note to be entered by the developer when creating a payment. Limit 500 characters. */ note?: string | undefined; /** * Optional additional payment information to include on the customer's card statement as part of the statement description. * This can be, for example, an invoice number, ticket number, or short description that uniquely identifies the purchase. * Note that the `statement_description_identifier` might get truncated on the statement description to fit the required * information including the Square identifier (SQ *) and name of the seller taking the payment. */ statement_description_identifier?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the [CreatePayment](#endpoint-payments-createpayment) endpoint. * @note 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 class CreatePaymentResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The newly created payment. */ payment?: Payment | undefined; } /** * Defines the body parameters that can be included in a request to the [CreateRefund](#endpoint-createrefund) endpoint. * @deprecated recommend using [RefundPayment](#endpoint-refunds-refundpayment) */ export class CreateRefundRequest { /** * A value you specify that uniquely identifies this refund among refunds you've created for the tender. * If you're unsure whether a particular refund succeeded, you can reattempt it with the same idempotency key without * worrying about duplicating the refund. See [Idempotency keys](#idempotencykeys) for more information. */ idempotency_key: string; /** * The ID of the tender to refund. A `Transaction` has one or more `tenders` (i.e., methods of payment) associated with it, * and you refund each tender separately with the Connect API. */ tender_id: string; /** * A description of the reason for the refund. Default value: `Refund via API` */ reason?: string | undefined; /** * The amount of money to refund. Note that you specify the amount in the __smallest denomination of the applicable currency__. * For example, US dollar amounts are specified in cents. * See [Working with monetary amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) for details. * This amount cannot exceed the amount that was originally charged to the tender that corresponds to `tender_id`. */ amount_money: Money; } /** * Defines the fields that are included in the response body of a request to the [CreateRefund](#endpoint-createrefund) endpoint. * One of `errors` or `refund` is present in a given response (never both). */ export class CreateRefundResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The created refund. */ refund?: Refund | undefined; } /** * Represents a request to create a `Shift`. */ export class CreateShiftRequest { /** * Unique string value to insure the idempotency of the operation. */ idempotency_key?: string | undefined; /** * The `Shift` to be created */ shift: Shift; } /** * The response to the request to create a `Shift`. * Contains the created `Shift` object. May contain a set of `Error` objects if the request resulted in errors. */ export class CreateShiftResponse { /** * The `Shift` that was created on the request. */ shift?: Shift | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines parameters in a [CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint request. */ export class CreateSubscriptionRequest { /** * A unique string that identifies this `CreateSubscription` request. * If you do not provide a unique string (or provide an empty string as the value), the endpoint treats each request as independent. * For more information, see [Idempotency keys](https://developer.squareup.com/docs/docs/working-with-apis/idempotency). */ idempotency_key: string; /** * The ID of the location the subscription is associated with. */ location_id: string; /** * The ID of the subscription plan. * For more information, see [Subscription Plan Overview](https://developer.squareup.com/docs/docs/subscriptions/overview). */ plan_id: string; /** * The ID of the `customer` profile. */ customer_id: string; /** * The start date of the subscription, in YYYY-MM-DD format. For example, 2013-01-15. * If the start date is left empty, the subscription begins immediately. */ start_date?: string | undefined; /** * The date when the subscription should be canceled, in YYYY-MM-DD format (for example, 2025-02-29). * This overrides the plan configuration if it comes before the date the subscription would otherwise end. */ canceled_date?: string | undefined; /** * The tax to add when billing the subscription. * The percentage is expressed in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. * For example, a value of 7.5 corresponds to 7.5%. */ tax_percentage?: string | undefined; /** * A custom price to apply for the subscription. If specified, it overrides the price configured by the subscription plan. */ price_override_money?: Money | undefined; /** * The ID of the `customer](#type-customer) [card` to charge. If not specified, Square sends an invoice via email. * For an example to create a customer and add a card on file, see [Subscriptions Walkthrough](https://developer.squareup.com/docs/docs/subscriptions-api/walkthrough). */ card_id?: string | undefined; /** * The timezone that is used in date calculations for the subscription. If unset, defaults to the location timezone. * If a timezone is not configured for the location, defaults to \"America/New_York\". * Format: the IANA Timezone Database identifier for the location timezone. * For a list of time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). */ timezone?: string | undefined; } /** * Defines the fields that are included in the response from the [CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint. */ export class CreateSubscriptionResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The newly created subscription. * For more information, see [Subscription object](https://developer.squareup.com/docs/docs/subscriptions-api/overview#subscription-object). */ subscription?: Subscription | undefined; } /** * Represents a create request for a `TeamMember` object. */ export class CreateTeamMemberRequest { /** * A unique string that identifies this CreateTeamMember request. * Keys can be any valid string but must be unique for every request. * See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. *
Min Length 1 Max Length 45 */ idempotency_key?: string | undefined; /** * The data which will be used to create the `TeamMember` object. */ team_member: TeamMember; } /** * Represents a response from a create request, containing the created `TeamMember` object or error messages. */ export class CreateTeamMemberResponse { /** * The successfully created `TeamMember` object. */ team_member?: TeamMember | undefined; /** * The errors that occurred during the request. */ errors?: Error[] | undefined; } export class CreateTerminalCheckoutRequest { /** * A unique string that identifies this `CreateCheckout` request. * Keys can be any valid string but must be unique for every `CreateCheckout` request. * See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ idempotency_key: string; /** * The checkout to create. */ checkout: TerminalCheckout; } export class CreateTerminalCheckoutResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The created `TerminalCheckout` */ checkout?: TerminalCheckout | undefined; } export class CreateTerminalRefundRequest { /** * A unique string that identifies this `CreateRefund` request. * Keys can be any valid string but must be unique for every `CreateRefund` request. * See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ idempotency_key: string; /** * The refund to create. */ refund?: TerminalRefund | undefined; } export class CreateTerminalRefundResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The created `TerminalRefund` */ refund?: TerminalRefund | undefined; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). */ export class Currency {} /** * Supported custom attribute query expressions for calling the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint * to search for items or item variations. */ export class CustomAttributeFilter { /** * A query expression to filter items or item variations by matching their custom attributes' * `custom_attribute_definition_id` property value against the the specified id. */ custom_attribute_definition_id?: string | undefined; /** * A query expression to filter items or item variations by matching their custom attributes' * `key` property value against the specified key. */ key?: string | undefined; /** * A query expression to filter items or item variations by matching their custom attributes' `string_value` * property value against the specified text. */ string_filter?: string | undefined; /** * A query expression to filter items or item variations with their custom attributes containing a number value within the specified range. */ number_filter?: Range | undefined; /** * A query expression to filter items or item variations by matching their custom attributes' * `selection_uid_values` values against the specified selection uids. */ selection_uids_filter?: string[] | undefined; /** * A query expression to filter items or item variations by matching their custom attributes' * `boolean_value` property values against the specified Boolean expression. */ bool_filter?: boolean | undefined; } /** * Represents a Square customer profile, which can have one or more cards on file associated with it. */ export class Customer { /** * A unique Square-assigned ID for the customer profile. */ id?: string | undefined; /** * The timestamp when the customer profile was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The timestamp when the customer profile was last updated, in RFC 3339 format. */ updated_at?: string | undefined; /** * Payment details of cards stored on file for the customer profile. */ cards?: Card[] | undefined; /** * The given (i.e., first) name associated with the customer profile. */ given_name?: string | undefined; /** * The family (i.e., last) name associated with the customer profile. */ family_name?: string | undefined; /** * A nickname for the customer profile. */ nickname?: string | undefined; /** * A business name associated with the customer profile. */ company_name?: string | undefined; /** * The email address associated with the customer profile. */ email_address?: string | undefined; /** * The physical address associated with the customer profile. */ address?: Address | undefined; /** * The 11-digit phone number associated with the customer profile. */ phone_number?: string | undefined; /** * The birthday associated with the customer profile, in RFC 3339 format. Year is optional, timezone and times are not allowed. * For example: * * `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st. * * `1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. */ birthday?: string | undefined; /** * An optional, second ID used to associate the customer profile with an entity in another system. */ reference_id?: string | undefined; /** * A custom note associated with the customer profile. */ note?: string | undefined; /** * Represents general customer preferences. */ preferences?: CustomerPreferences | undefined; /** * The customer groups and segments the customer belongs to. * This deprecated field has been replaced with the dedicated `group_ids` for customer groups and the dedicated * `segment_ids` field for customer segments. You can retrieve information about a given customer group and segment * respectively using the Customer Groups API and Customer Segments API. */ groups?: CustomerGroupInfo[] | undefined; /** * A creation source represents the method used to create the customer profile. * See [CustomerCreationSource](#type-customercreationsource) for possible values. */ creation_source?: CustomerSourceType | undefined; /** * The IDs of customer groups the customer belongs to. */ group_ids?: string[] | undefined; /** * The IDs of segments the customer belongs to. */ segment_ids?: string[] | undefined; } /** * Indicates the method used to create the customer profile. */ export class CustomerCreationSource {} /** * 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 class CustomerCreationSourceFilter { /** * The list of creation sources used as filtering criteria. * See [CustomerCreationSource](#type-customercreationsource) for possible values. */ values?: CustomerSourceType[] | undefined; /** * Indicates whether a customer profile matching the filter criteria should be included in the result or excluded * from the result. Default: `INCLUDE`. * See [CustomerInclusionExclusion](#type-customerinclusionexclusion) for possible values. */ rule?: "INCLUDE" | "EXCLUDE" | undefined; } /** * Represents a set of `CustomerQuery` filters used to limit the set of `Customers` returned by `SearchCustomers`. */ export class CustomerFilter { /** * A filter to select customers based on their creation source. */ creation_source?: CustomerCreationSourceFilter | undefined; /** * A filter to select customers based on when they were created. */ created_at?: TimeRange | undefined; /** * A filter to select customers based on when they were updated. */ updated_at?: TimeRange | undefined; /** * A filter to [select customers by email address](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#search-by-email-address) visible to the seller. * This filter is case insensitive. For [exact matching](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#exact-search-by-email-address), * this filter causes the search to return customer profiles whose `email_address` field value are identical to the email address provided in the query. * For [fuzzy matching](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#fuzzy-search-by-email-address), * this filter causes the search to return customer profiles whose `email_address` field value has a token-wise partial * match against the filtering expression in the query. For example, with `Steven gmail` provided in a search query, * the search returns customers whose email address can be `steven.johnson@gmail.com` or `mygmail@stevensbakery.com`. * Email addresses are tokenized by replacing, by spaces, punctuations including periods (`.`), underscores (`_`), * and the `@` symbols. A match is found if a tokenized email address contains all the tokens in the search query,irrespective of the token order. */ email_address?: CustomerTextFilter | undefined; /** * A filter to [select customers by their phone numbers](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#search-by-phone-number) visible to the seller. * This filter is case insensitive. For [exact matching](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#exact-search-by-phone-number), * this filter causes the search to return customers whose phone number matches the specified query expression. * The number in the query must be of an E.164-compliant form. In particular, it must include the leading `+` * sign followed by a contry code and then a subscriber number. The standard E.614 form of a US phone number is * `+12061112222` of the domestic version or `+0012061112222` of the international version. The E.164-compliant variations * include `+1 (206) 111-2222` or `+001 (206) 111-2222`, respectively. To match the query expression, stored customers' * phone numbers are converted to the standard E.164 form of the national and internationalized versions. * For [fuzzy matching](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#fuzzy-search-by-phone-number), * this filter causes the search to return customers whose phone number matches partially the token or tokens * provided in the query expression. For example, if the search query contains `415-123-45`, the filter selects those * customers with phone numbers of `415-123-4567` or `234-151-2345`. The search does not return customers with the * phone number of `415-123-4678`. Similarly, if the search query contains `415` as part of the phone number, the * search returns those customers with phone numbers of `(415)-123-4567`, `(123) 415-1567`, and `1 (415) 123-4567`. */ phone_number?: CustomerTextFilter | undefined; /** * A filter to [select customers by their reference IDs](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#search-by-reference-id). * This filter is case insensitive. [Exact matching](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#exact-search-by-reference-id) * of a customer's reference ID against a query's reference ID is evaluated as exact match between two strings, * character by character in the given order. [Fuzzy matching](https://developer.squareup.com/docs/docs/customers-api/cookbook/search-customers#fuzzy-search-by-reference-id) * of stored reference IDs against queried reference IDs works exactly the same as fuzzy matching on email addresses. * Non-alphanumeric characters are replaced by spaces to tokenize stored and queried reference IDs. * A match is found if a tokenized stored reference ID contains all tokens specified in any order in the query. * For example, a query of `NYC M` will match customer profiles with the `reference_id` value of `NYC_M_35_JOHNSON` and `NYC_27_MURRAY`. */ reference_id?: CustomerTextFilter | undefined; /** * A filter to select customers based on their group membership. * The `group_ids` is a JSON object of the following general format: * ``` \"group_ids\": { \"any\": [\"{group_a_id}\", \"{group_b_id}\", ...], \"all\": [\"{group_1_id}\", \"{group_2_id}\", ...], 'none\": [\"{group_i_id}\", \"{group_ii_id}\", ...] } ``` * You can use any combination of the above `group_ids` fields (also known as `FilterValue` properties) * to specify how customers are selected based on their group membership. With the `any` option, the search returns * customers in Groups `A` or `B` or ... of the list. With the `all` option, the search returns customers in Groups * `1` and `2` and ... of the list. With the `none` option, the search returns customers not in Groups `i` and not * in `ii` and not in ... of the list. If any of the search conditions are not met, including when an invalid or * non-existent group ID is provided, the result is an empty list. You can use the `group_ids` search filter with * other available filters. You cannot use the `group_ids` filter to select customers based on segment membership. */ group_ids?: FilterValue | undefined; } /** * Represents a group of customer profiles. Customer groups can be created, modified, and have their membership defined either via * the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. */ export class CustomerGroup { /** * Unique Square-generated ID for the customer group. */ id?: string | undefined; /** * Name of the customer group. */ name: string; /** * The timestamp when the customer group was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The timestamp when the customer group was last updated, in RFC 3339 format. */ updated_at?: string | undefined; } /** * Contains some brief information about a Customer Group with its identifier included. */ export class CustomerGroupInfo { /** * The ID of the Customer Group. */ id: string; /** * The name of the Customer Group. */ name: string; } /** * Indicates whether customers should be included in, or excluded from, the result set when they match the filtering criteria. */ export class CustomerInclusionExclusion {} /** * Represents communication preferences for the customer profile. */ export class CustomerPreferences { /** * The customer has unsubscribed from receiving marketing campaign emails. */ email_unsubscribed?: boolean | undefined; } /** * Represents a query (including filtering criteria, sorting criteria, or both) used to search for customer profiles. */ export class CustomerQuery { /** * A list of filtering criteria. */ filter?: CustomerFilter | undefined; /** * Sorting criteria for query results. The default behavior is to sort customers alphabetically by `given_name` and `family_name`. */ sort?: CustomerSort | undefined; } /** * 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 Customer Directory in the Square Dashboard or Point of Sale. */ export class CustomerSegment { /** * Unique Square-generated ID for the segment. */ id?: string | undefined; /** * Name of the segment. */ name: string; /** * The timestamp when the segment was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The timestamp when the segment was last updated, in RFC 3339 format. */ updated_at?: string | undefined; } /** * Specifies how searched customers profiles are sorted, including the sort key and sort order. */ export class CustomerSort { /** * Use one or more customer attributes as the sort key to sort searched customer profiles. * For example, use creation date (`created_at`) of customers or default attributes as the sort key. * Default: `DEFAULT`. See [CustomerSortField](#type-customersortfield) for possible values. */ field?: string | undefined; /** * Indicates the order in which results should be sorted based on the sort field value. * Strings use standard alphabetic comparison to determine order. Strings representing numbers are sorted as strings. * Default: `ASC`. See [SortOrder](#type-sortorder) for possible values. */ order?: SortOrderType | undefined; } /** * Specifies customer attributes as the sort key to customer profiles returned from a search. */ export class CustomerSortField {} /** * A filter to select customers based on exact or fuzzy matching of customer attributes against a specified query. * Depending on customer attributes, the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. */ export class CustomerTextFilter { /** * Use the exact filter to select customers whose attributes match exactly the specified query. */ exact?: string | undefined; /** * Use the fuzzy filter to select customers whose attributes match the specified query in a fuzzy manner. * When the fuzzy option is used, search queries are tokenized, and then each query token must be matched somewhere in the searched attribute. * For single token queries, this is effectively the same behavior as a partial match operation. */ fuzzy?: string | undefined; } /** * A range defined by two dates. Used for filtering a query for Connect v2 objects that have date properties. */ export class DateRange { /** * String in `YYYY-MM-DD` format, e.g. `2017-10-31` per the ISO 8601 extended format for calendar dates. * The beginning of a date range (inclusive). */ start_date?: string | undefined; /** * String in `YYYY-MM-DD` format, e.g. `2017-10-31` per the ISO 8601 extended format for calendar dates. * The end of a date range (inclusive) */ end_date?: string | undefined; } /** * Indicates the specific day of the week. */ export class DayOfWeek {} /** * A request to delete a `BreakType` */ export class DeleteBreakTypeRequest {} /** * The response to a request to delete a `BreakType`. May contain a set of `Error` objects if the request resulted in errors. */ export class DeleteBreakTypeResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class DeleteCatalogObjectRequest {} export class DeleteCatalogObjectResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The IDs of all catalog objects deleted by this request. Multiple IDs may be returned when associated objects * are also deleted, for example a catalog item variation will be deleted (and its ID included in this field) * when its parent catalog item is deleted. */ deleted_object_ids?: string[] | undefined; /** * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this deletion * in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. */ deleted_at?: string | undefined; } /** * Defines the fields that are included in requests to the DeleteCustomerCard endpoint. */ export class DeleteCustomerCardRequest {} /** * Defines the fields that are included in the response body of a request to the DeleteCustomerCard endpoint. */ export class DeleteCustomerCardResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines the fields that can be provided in a request to the [DeleteCustomerGroup](#endpoint-deletecustomergroup) endpoint. */ export class DeleteCustomerGroupRequest {} /** * Defines the fields that are included in the response body of a request to the [DeleteCustomerGroup](#endpoint-deletecustomergroup) endpoint. */ export class DeleteCustomerGroupResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines the fields that are included in a request to the DeleteCustomer endpoint. */ export class DeleteCustomerRequest {} /** * Defines the fields that are included in the response body of a request to the DeleteCustomer endpoint. */ export class DeleteCustomerResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Describes a `DeleteInvoice` request. */ export class DeleteInvoiceRequest { /** * The version of the `invoice` to delete. If you do not know the version, you can call `GetInvoice` or `ListInvoices`. */ version?: number | undefined; } /** * Describes a `DeleteInvoice` response. */ export class DeleteInvoiceResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; } /** * A request to delete a loyalty reward. */ export class DeleteLoyaltyRewardRequest {} /** * A response returned by the API call. */ export class DeleteLoyaltyRewardResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * A request to delete a `Shift`. */ export class DeleteShiftRequest {} /** * The response to a request to delete a `Shift`. May contain a set of `Error` objects if the request resulted in errors. */ export class DeleteShiftResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class Device { /** * The device's Square-issued ID. */ id?: string | undefined; /** * The device's merchant-specified name. */ name?: string | undefined; } export class DeviceCheckoutOptions { /** * The unique ID of the device intended for this `TerminalCheckout`. * A list of `DeviceCode` objects can be retrieved from the /v2/devices/codes endpoint. * Match a `DeviceCode.device_id` value with `device_id` to get the associated device code. */ device_id: string; /** * Instruct the device to skip the receipt screen. Defaults to false. */ skip_receipt_screen?: boolean | undefined; /** * Tip specific settings */ tip_settings?: TipSettings | undefined; } export class DeviceCode { /** * The unique id for this device code. */ id?: string | undefined; /** * An optional user-defined name for the device code. */ name?: string | undefined; /** * The unique code that can be used to login. */ code?: string | undefined; /** * The unique id of the device that used this code. Populated when the device is paired up. */ device_id?: string | undefined; /** * The targeting product type of the device code. See [ProductType](#type-producttype) for possible values. */ product_type: string; /** * The location assigned to this code. */ location_id?: string | undefined; /** * The pairing status of the device code. See [DeviceCodeStatus](#type-devicecodestatus) for possible values. */ status?: string | undefined; /** * When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format. */ pair_by?: string | undefined; /** * When this DeviceCode was created. Timestamp in RFC 3339 format. */ created_at?: string | undefined; /** * When this DeviceCode's status was last changed. Timestamp in RFC 3339 format. */ status_changed_at?: string | undefined; /** * When this DeviceCode was paired. Timestamp in RFC 3339 format. */ paired_at?: string | undefined; } /** * DeviceCode.Status enum. */ export class DeviceCodeStatus {} /** * Details about the device that took the payment. */ export class DeviceDetails { /** * Square-issued ID of the device. */ device_id?: string | undefined; /** * Square-issued installation ID for the device. */ device_installation_id?: string | undefined; /** * The name of the device set by the merchant. */ device_name?: string | undefined; } /** * Represents a dispute a cardholder initiated with their bank. */ export class Dispute { /** * Unique ID for this `Dispute`, generated by Square. */ dispute_id?: string | undefined; /** * The disputed amount. The amount can be less than the entire transaction amount. * For example, a cardholder purchased multiple items, however initiated dispute only for some of the items. */ amount_money?: Money | undefined; /** * The dispute reason why cardholder initiated dispute with their bank. See [DisputeReason](#type-disputereason) for possible values */ reason?: string | undefined; /** * The current state of this dispute. See [DisputeState](#type-disputestate) for possible values */ state?: string | undefined; /** * The time when the next action is due, in RFC 3339 format. */ due_at?: string | undefined; /** * The payment challenged in this dispute. */ disputed_payment?: DisputedPayment | undefined; /** * The IDs of the evidence associated with the dispute. */ evidence_ids?: string[] | undefined; /** * The card brand used in the disputed payment. See [CardBrand](#type-cardbrand) for possible values */ card_brand?: string | undefined; /** * Timestamp when the dispute was created, in RFC 3339 format. */ created_at?: string | undefined; /** * Timestamp when dispute was last updated, in RFC 3339 format. */ updated_at?: string | undefined; /** * ID of the dispute in the card brand system, generated by the card brand. */ brand_dispute_id?: string | undefined; /** * Timestamp when the dispute was reported, in RFC 3339 format. */ reported_date?: string | undefined; /** * The current version of the `Dispute`. */ version?: number | undefined; /** * The ID of location where dispute originated. */ location_id?: string | undefined; } export class DisputeEvidence { /** * The Square-generated ID of the evidence. */ evidence_id?: string | undefined; /** * The ID of the dispute the evidence is associated with. */ dispute_id?: string | undefined; /** * The time when the next action is due, in RFC 3339 format. */ uploaded_at?: string | undefined; /** * The type of the evidence. See [DisputeEvidenceType](#type-disputeevidencetype) for possible values */ evidence_type?: string | undefined; } /** * A file to be uploaded as dispute evidence. */ export class DisputeEvidenceFile { /** * The file name including the file extension. For example: \"receipt.tiff\". */ filename?: string | undefined; /** * Dispute evidence files must one of application/pdf, image/heic, image/heif, image/jpeg, image/png, image/tiff formats. */ filetype?: string | undefined; } /** * Type of the dispute evidence. */ export class DisputeEvidenceType {} /** * List of possible reasons why a cardholder might initiate a dispute with their bank. */ export class DisputeReason {} /** * List of possible dispute states. */ export class DisputeState {} /** * The payment the cardholder disputed. */ export class DisputedPayment { /** * Square-generated unique ID of the payment being disputed. */ payment_id?: string | undefined; } /** * Determines item visibility in Ecom (Online Store) and Online Checkout. */ export class EcomVisibility {} /** * AAn employee object that is used by the external API. */ export class Employee { /** * UUID for this object. */ id?: string | undefined; /** * The employee's first name. */ first_name?: string | undefined; /** * The employee's last name. */ last_name?: string | undefined; /** * The employee's email address */ email?: string | undefined; /** * The employee's phone number in E.164 format, i.e. "+12125554250" */ phone_number?: string | undefined; /** * A list of location IDs where this employee has access to. */ location_ids?: string[] | undefined; /** * Specifies the status of the employees being fetched. See [EmployeeStatus](#type-employeestatus) for possible values. */ status?: ActivityStatusType | undefined; /** * Whether this employee is the owner of the merchant. Each merchant has one owner employee, and that employee has full authority over the account. */ is_owner?: boolean | undefined; /** * A read-only timestamp in RFC 3339 format. */ created_at?: string | undefined; /** * A read-only timestamp in RFC 3339 format. */ updated_at?: string | undefined; } /** * The status of the Employee being retrieved. */ export class EmployeeStatus {} /** * The hourly wage rate that an employee will earn on a `Shift` for doing the job specified by the `title` property of this object. * Deprecated at version 2020-08-26. Use `TeamMemberWage` instead. */ export class EmployeeWage { /** * UUID for this object. */ id?: string | undefined; /** * The `Employee` that this wage is assigned to. */ employee_id?: string | undefined; /** * The job title that this wage relates to. */ title?: string | undefined; /** * Can be a custom-set hourly wage or the calculated effective hourly wage based on annual wage and hours worked per * week. */ hourly_rate?: Money | undefined; } /** * Indicates which high-level category of error has occurred during a request to the Connect API. */ export class ErrorCategory {} /** * Indicates the specific error that occurred during a request to a Square API. */ export class ErrorCode {} /** * Indicates which products matched by a CatalogPricingRule will be excluded if the pricing rule uses an exclude set. */ export class ExcludeStrategy {} /** * 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 class FilterValue { /** * A list of terms that must be present on the field of the resource. */ all?: string[] | undefined; /** * A list of terms where at least one of them must be present on the field of the resource. */ any?: string[] | undefined; /** * A list of terms that must not be present on the field the resource */ none?: string[] | undefined; } /** * Request object for fetching a specific `BankAccount` by the object ID. */ export class GetBankAccountByV1IdRequest {} /** * Request object to fetch a specific `BankAccount` by the object ID. */ export class GetBankAccountRequest {} /** * Response object returned by `GetBankAccount`. */ export class GetBankAccountResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested `BankAccount` object. */ bank_account?: BankAccount | undefined; } /** * A request to GET a `BreakType` by ID. */ export class GetBreakTypeRequest {} /** * The response to a request to get a `BreakType`. Contains the requested `BreakType` objects. * May contain a set of `Error` objects if the request resulted in errors. */ export class GetBreakTypeResponse { /** * The response object. */ break_type?: BreakType | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class GetDeviceCodeRequest {} export class GetDeviceCodeResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The queried DeviceCode. */ device_code?: DeviceCode | undefined; } /** * A request to get an `EmployeeWage` */ export class GetEmployeeWageRequest {} /** * A response to a request to get an `EmployeeWage`. Contains the requested `EmployeeWage` objects. * May contain a set of `Error` objects if the request resulted in errors. */ export class GetEmployeeWageResponse { /** * The requested `EmployeeWage` object. */ employee_wage?: EmployeeWage | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Describes a `GetInvoice` request. */ export class GetInvoiceRequest {} /** * Describes a `GetInvoice` response. */ export class GetInvoiceResponse { /** * The invoice requested. */ invoice?: Invoice | undefined; /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; } /** * Retrieves a specific `Refund` using the `refund_id`. */ export class GetPaymentRefundRequest {} /** * Defines the fields that are included in the response body of a request to the * [GetRefund](#endpoint-refunds-getpaymentrefund) endpoint. * @note if there are errors processing the request, the refund field may not be present, or it may be present in a FAILED state. */ export class GetPaymentRefundResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested `PaymentRefund`. */ refund?: PaymentRefund | undefined; } /** * Retrieve details for a specific payment. */ export class GetPaymentRequest {} /** * Defines the fields that are included in the response body of a request to the [GetPayment](#endpoint-payments-getpayment) endpoint. */ export class GetPaymentResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested `Payment`. */ payment?: Payment | undefined; } /** * A request to get a `Shift` by ID. */ export class GetShiftRequest {} /** * A response to request to get a `Shift`. Contains the requested `Shift` object. * May contain a set of `Error` objects if the request resulted in errors. */ export class GetShiftResponse { /** * The requested `Shift`. */ shift?: Shift | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * A request to get an `TeamMemberWage` */ export class GetTeamMemberWageRequest {} /** * A response to a request to get a `TeamMemberWage`. Contains the requested `TeamMemberWage` objects. * May contain a set of `Error` objects if the request resulted in errors. */ export class GetTeamMemberWageResponse { /** * The requested `TeamMemberWage` object. */ team_member_wage?: TeamMemberWage | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class GetTerminalCheckoutRequest {} export class GetTerminalCheckoutResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested `TerminalCheckout` */ checkout?: TerminalCheckout | undefined; } export class GetTerminalRefundRequest {} export class GetTerminalRefundResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested `Refund` */ refund?: TerminalRefund | undefined; } /** * Object types to inline under their respective parent object in certain connect v2 responses. */ export class InlineTypes {} /** * Represents a change in state or quantity of product inventory at a particular time and location. */ export class InventoryAdjustment { /** * A unique ID generated by Square for the `InventoryAdjustment`. */ id?: string | undefined; /** * An optional ID provided by the application to tie the `InventoryAdjustment` to an external system. */ reference_id?: string | undefined; /** * The `InventoryState` of the related quantity of items before the adjustment. See [InventoryState](#type-inventorystate) for possible values */ from_state?: InventoryStateType | undefined; /** * The `InventoryState` of the related quantity of items after the adjustment. See [InventoryState](#type-inventorystate) for possible values */ to_state?: InventoryStateType | undefined; /** * The Square ID of the `Location` where the related quantity of items are being tracked. */ location_id?: string | undefined; /** * The Square generated ID of the `CatalogObject` being tracked. */ catalog_object_id?: string | undefined; /** * The `CatalogObjectType` of the `CatalogObject` being tracked. Tracking is only supported for the `ITEM_VARIATION` type. */ catalog_object_type?: string | undefined; /** * The number of items affected by the adjustment as a decimal string. Can support up to 5 digits after the decimal point. */ quantity?: string | undefined; /** * The read-only total price paid for goods associated with the adjustment. * Present if and only if `to_state` is `SOLD`. Always non-negative. */ total_price_money?: Money | undefined; /** * A client-generated timestamp in RFC 3339 format that indicates when the adjustment took place. For write actions, * the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request. */ occurred_at?: string | undefined; /** * A read-only timestamp in RFC 3339 format that indicates when Square received the adjustment. */ created_at?: string | undefined; /** * Read-only information about the application that caused the inventory adjustment. */ source?: SourceApplication | undefined; /** * The Square ID of the `Employee` responsible for the inventory adjustment. */ employee_id?: string | undefined; /** * The read-only Square ID of the [Transaction][#type-transaction] that caused the adjustment. Only relevant for * payment-related state transitions. */ transaction_id?: string | undefined; /** * The read-only Square ID of the [Refund][#type-refund] that caused the adjustment. Only relevant for * refund-related state transitions. */ refund_id?: string | undefined; /** * The read-only Square ID of the purchase order that caused the adjustment. Only relevant for state transitions * from the Square for Retail app. */ purchase_order_id?: string | undefined; /** * The read-only Square ID of the Square goods receipt that caused the adjustment. Only relevant for state * transitions from the Square for Retail app. */ goods_receipt_id?: string | undefined; } /** * Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. */ export class InventoryAlertType {} /** * Represents a single physical count, inventory, adjustment, or transfer that is part of the history of inventory * changes for a particular `CatalogObject`. */ export class InventoryChange { /** * Indicates how the inventory change was applied. See `InventoryChangeType` for all possible values. * See [InventoryChangeType](#type-inventorychangetype) for possible values. */ type?: InventoryType | undefined; /** * Contains details about the physical count when `type` is `PHYSICAL_COUNT` and unset for all other types. */ physical_count?: InventoryPhysicalCount | undefined; /** * Contains details about the inventory adjustment when `type` is `ADJUSTMENT` and unset for all other types. */ adjustment?: InventoryAdjustment | undefined; /** * Contains details about the inventory transfer when `type` is `TRANSFER` and unset for all other types. * @note An `InventoryTransfer` object is read-only and can only be present in a `RetrieveInventoryChangesResponse` * and `BatchRetrieveInventoryChangesResponse` object. */ transfer?: InventoryTransfer | undefined; } /** * Indicates how the inventory change was applied to a tracked quantity of items. */ export class InventoryChangeType {} /** * Represents Square's estimated quantity of items in a particular state at a particular location based on the known * history of physical counts and inventory adjustments. */ export class InventoryCount { /** * The Square generated ID of the `CatalogObject` being tracked. */ catalog_object_id?: string | undefined; /** * The `CatalogObjectType` of the `CatalogObject` being tracked. Tracking is only supported for the `ITEM_VARIATION` type. */ catalog_object_type?: string | undefined; /** * The current `InventoryState` for the related quantity of items. See [InventoryState](#type-inventorystate) for possible values */ state?: InventoryStateType | undefined; /** * The Square ID of the `Location` where the related quantity of items are being tracked. */ location_id?: string | undefined; /** * The number of items affected by the estimated count as a decimal string. Can support up to 5 digits after the decimal point. */ quantity?: string | undefined; /** * A read-only timestamp in RFC 3339 format that indicates when Square received the most recent physical count or * adjustment that had an affect on the estimated count. */ calculated_at?: string | undefined; } /** * 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 class InventoryPhysicalCount { /** * A unique ID generated by Square for the `InventoryPhysicalCount`. */ id?: string | undefined; /** * An optional ID provided by the application to tie the `InventoryPhysicalCount` to an external system. */ reference_id?: string | undefined; /** * The Square generated ID of the `CatalogObject` being tracked. */ catalog_object_id?: string | undefined; /** * The `CatalogObjectType` of the `CatalogObject` being tracked. Tracking is only supported for the `ITEM_VARIATION` type. */ catalog_object_type?: string | undefined; /** * The current `InventoryState` for the related quantity of items. * See [InventoryState](#type-inventorystate) for possible values. */ state?: InventoryStateType | undefined; /** * The Square ID of the `Location` where the related quantity of items are being tracked. */ location_id?: string | undefined; /** * The number of items affected by the physical count as a decimal string. Can support up to 5 digits after the decimal point. */ quantity?: string | undefined; /** * Read-only information about the application that submitted the physical count. */ source?: SourceApplication | undefined; /** * The Square ID of the `Employee` responsible for the physical count. */ employee_id?: string | undefined; /** * A client-generated timestamp in RFC 3339 format that indicates when the physical count took place. For write actions, * the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request. */ occurred_at?: string | undefined; /** * A read-only timestamp in RFC 3339 format that indicates when Square received the physical count. */ created_at?: string | undefined; } /** * Indicates the state of a tracked item quantity in the lifecycle of goods. */ export class InventoryState {} /** * Represents the transfer of a quantity of product inventory at a particular time from one location to another. */ export class InventoryTransfer { /** * A unique ID generated by Square for the `InventoryTransfer`. */ id?: string | undefined; /** * An optional ID provided by the application to tie the `InventoryTransfer` to an external system. */ reference_id?: string | undefined; /** * The `InventoryState` for the quantity of items being transferred. See [InventoryState](#type-inventorystate) for possible values. */ state?: InventoryStateType | undefined; /** * The Square ID of the `Location` where the related quantity of items were tracked before the transfer. */ from_location_id?: string | undefined; /** * The Square ID of the `Location` where the related quantity of items were tracked after the transfer. */ to_location_id?: string | undefined; /** * The Square generated ID of the `CatalogObject` being tracked. */ catalog_object_id?: string | undefined; /** * The `CatalogObjectType` of the `CatalogObject` being tracked.Tracking is only supported for the `ITEM_VARIATION` type. */ catalog_object_type?: string | undefined; /** * The number of items affected by the transfer as a decimal string. Can support up to 5 digits after the decimal point. */ quantity?: string | undefined; /** * A client-generated timestamp in RFC 3339 format that indicates when the transfer took place. For write actions, * the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request. */ occurred_at?: string | undefined; /** * A read-only timestamp in RFC 3339 format that indicates when Square received the transfer request. */ created_at?: string | undefined; /** * Read-only information about the application that initiated the inventory transfer. */ source?: SourceApplication | undefined; /** * The Square ID of the `Employee` responsible for the inventory transfer. */ employee_id?: string | undefined; } /** * Stores information about an invoice. You use the Invoices API to create and process invoices. * For more information, see [Manage Invoices Using the Invoices API](/docs/invoices-api/overview). */ export class Invoice { /** * The Square-assigned ID of the invoice. */ id?: string | undefined; /** * The Square-assigned version number, which is incremented each time an update is committed to the invoice. */ version?: number | undefined; /** * The ID of the location that this invoice is associated with. This field is required when creating an invoice. */ location_id?: string | undefined; /** * The ID of the `order` for which the invoice is created. * This order must be in the `OPEN` state and must belong to the `location_id` specified for this invoice. * This field is required when creating an invoice. */ order_id?: string | undefined; /** * The customer who gets the invoice. Square uses the contact information to deliver the invoice. * This field is required to publish an invoice. */ primary_recipient?: InvoiceRecipient | undefined; /** * An array of `InvoicePaymentRequest` objects. Each object defines a payment request in an invoice payment schedule. * It provides information such as when and how Square processes payments. You must specify at least one payment request. * For invoices with multiple payment requests, you can specify a maximum of 12 `INSTALLMENT` request types. * All of the payment requests must specify the same `request_method`. This field is required when creating an invoice. */ payment_requests?: InvoicePaymentRequest[] | undefined; /** * A user-friendly invoice number. The value is unique within a location. * If not provided when creating an invoice, Square assigns a value. * It increments from 1 and padded with zeros making it 7 characters long for example, 0000001, 0000002. */ invoice_number?: string | undefined; /** * The title of the invoice. */ title?: string | undefined; /** * The description of the invoice. This is visible the customer receiving the invoice. */ description?: string | undefined; /** * The timestamp when the invoice is scheduled for processing, in RFC 3339 format. At the specified time, depending * on the `request_method`, Square sends the invoice to the customer's email address or charge the customer's card on file. * If the field is not set, Square processes the invoice immediately after publication. */ scheduled_at?: string | undefined; /** * The URL of the Square-hosted invoice page. After you publish the invoice using the `PublishInvoice` endpoint, * Square hosts the invoice page and returns the page URL in the response. */ public_url?: string | undefined; /** * The current amount due for the invoice. * In addition to the amount due on the next payment request, this also includes any overdue payment amounts. */ next_payment_amount_money?: Money | undefined; /** * The status of the invoice. See [InvoiceStatus](#type-invoicestatus) for possible values */ status?: string | undefined; /** * The time zone of the date values (for example, `due_date`) specified in the invoice. */ timezone?: string | undefined; /** * The timestamp when the invoice was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The timestamp when the invoice was last updated, in RFC 3339 format. */ updated_at?: string | undefined; } /** * Describes query filters to apply. */ export class InvoiceFilter { /** * Limits the search to the specified locations. A location is required. * In the current implementation, only one location can be specified. */ location_ids: string[]; /** * Limits the search to the specified customers, within the specified locations. * Specifying a customer is optional. In the current implementation, a maximum of one customer can be specified. */ customer_ids?: string[] | undefined; } /** * 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 class InvoicePaymentReminder { /** * A Square-assigned ID that uniquely identifies the reminder within the `InvoicePaymentRequest`. */ uid?: string | undefined; /** * The number of days before (a negative number) or after (a positive number) the payment request `due_date` when the reminder is sent. * For example, -3 indicates that the reminder should be sent 3 days before the payment request `due_date`. */ relative_scheduled_days?: number | undefined; /** * The reminder message. */ message?: string | undefined; /** * The status of the reminder. See [InvoicePaymentReminderStatus](#type-invoicepaymentreminderstatus) for possible values. */ status?: string | undefined; /** * If sent, the timestamp when the reminder was sent, in RFC 3339 format. */ sent_at?: string | undefined; } /** * The status of a payment request reminder. */ export class InvoicePaymentReminderStatus {} /** * Describes a specific payment request in an invoice. * Invoices that contain multiple payment requests can specify a maximum of 12 `INSTALLMENT` request types. * All of the payment requests must specify the same `request_method`. * For more information, see [Payment requests](/docs/invoices-api/overview#payment-requests). */ export class InvoicePaymentRequest { /** * The Square-generated ID of the payment request in an `invoice`. */ uid?: string | undefined; /** * Indicates how Square processes the payment request. See [InvoiceRequestMethod](#type-invoicerequestmethod) for possible values. */ request_method?: string | undefined; /** * Identifies the payment request type. This type defines how the payment request amount is determined. * See [InvoiceRequestType](#type-invoicerequesttype) for possible values. */ request_type?: string | undefined; /** * The due date (in the invoice location's time zone) for the payment request. After this date, the invoice becomes overdue. */ due_date?: string | undefined; /** * If the payment request specifies `DEPOSIT` or `INSTALLMENT` as the `request_type`, this indicates the request amount. * You cannot specify this when `request_type` is `BALANCE` or when the payment request includes the `percentage_requested` field. */ fixed_amount_requested_money?: Money | undefined; /** * Specifies the amount for the payment request in percentage: * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order total amount. * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order total less the deposit, * if requested. The sum of the `percentage_requested` in all installment payment requests must be equal to 100. * You cannot specify this when the payment `request_type` is `BALANCE` or when the payment request specifies the * `fixed_amount_requested_money` field. */ percentage_requested?: string | undefined; /** * If set to true, the Square-hosted invoice page (the `public_url` field of the invoice) provides a place for the customer to pay a tip. * This field is allowed only on the final payment request and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. */ tipping_enabled?: boolean | undefined; /** * If the request method is `CHARGE_CARD_ON_FILE`, this field provides the card to charge. */ card_id?: string | undefined; /** * A list of one or more reminders to send for the payment request. */ reminders?: InvoicePaymentReminder[] | undefined; /** * The payment request amount, computed using the order amount and information from the various payment * request fields (`invoice_request_type`, `fixed_amount_requested_money`, and `percentage_requested`). */ computed_amount_money?: Money | undefined; /** * The amount of money already paid for the specific payment request. * This amount might include a rounding adjustment if the most recent invoice payment was in cash in a currency * that rounds cash payments (such as, `CAD` or `AUD`). */ total_completed_amount_money?: Money | undefined; /** * If the most recent payment was a cash payment in a currency that rounds cash payments (such as, `CAD` or `AUD`) * and the payment is rounded from `computed_amount_money` in the payment request, then this field specifies the * rounding adjustment applied. This amount might be negative. */ rounding_adjustment_included_money?: Money | undefined; } /** * Describes query criteria for searching invoices. */ export class InvoiceQuery { /** * Query filters to apply in searching invoices. * For more information, see [Retrieve invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#retrieve-invoices). */ filter: InvoiceFilter; /** * Describes the sort order for the search result. */ sort?: InvoiceSort | undefined; } /** * Provides customer data that Square uses to deliver an invoice. */ export class InvoiceRecipient { /** * The ID of the customer. This is the customer profile ID that you provide when creating a draft invoice. */ customer_id?: string | undefined; /** * The recipient's given (that is, first) name. */ given_name?: string | undefined; /** * The recipient's family (that is, last) name. */ family_name?: string | undefined; /** * The recipient's email address. */ email_address?: string | undefined; /** * The recipient's physical address. */ address?: Address | undefined; /** * The recipient's phone number. */ phone_number?: string | undefined; /** * The name of the recipient's company. */ company_name?: string | undefined; } /** * 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. */ export class InvoiceRequestMethod {} /** * Indicates the type of the payment request. An invoice supports the following payment request combinations: * - 1 balance - 1 deposit with 1 balance - 2 - 12 installments - 1 deposit with 2 - 12 installments * For more information, see [Payment requests](https://developer.squareup.com/docs/docs/invoices-api/overview#payment-requests). */ export class InvoiceRequestType {} /** * Identifies the sort field and sort order. */ export class InvoiceSort { /** * The field to sort on. See [InvoiceSortField](#type-invoicesortfield) for possible values. */ field: string; /** * The order to use for sorting the results. See [SortOrder](#type-sortorder) for possible values. */ order?: string | undefined; } /** * Field to use for sorting. */ export class InvoiceSortField {} /** * Indicates the status of an invoice. */ export class InvoiceStatus {} /** * Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`. */ export class ItemVariationLocationOverrides { /** * The ID of the `Location`. */ location_id?: string | undefined; /** * The price of the `CatalogItemVariation` at the given `Location`, or blank for variable pricing. */ price_money?: Money | undefined; /** * The pricing type (fixed or variable) for the `CatalogItemVariation` at the given `Location`. * See [CatalogPricingType](#type-catalogpricingtype) for possible values. */ pricing_type?: string | undefined; /** * If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. */ track_inventory?: boolean | undefined; /** * Indicates whether the `CatalogItemVariation` displays an alert when its inventory quantity is less than or * equal to its `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for possible values. */ inventory_alert_type?: "NONE" | "LOW_QUANTITY" | undefined; /** * If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is * `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer. */ inventory_alert_threshold?: number | undefined; } /** * An object describing a job that a team member is assigned to. */ export class JobAssignment { /** * The title of the job. */ job_title: string; /** * The current pay type for the job assignment used to calculate the pay amount in a pay period. * See [JobAssignmentPayType](#type-jobassignmentpaytype) for possible values. */ pay_type: string; /** * The hourly pay rate of the job. */ hourly_rate?: Money | undefined; /** * The total pay amount for a 12 month period on the job. Set if the job `PayType` is `SALARY`. */ annual_rate?: Money | undefined; /** * The planned hours per week for the job. Set if the job `PayType` is `SALARY`. */ weekly_hours?: number | undefined; } /** * Enumerates the possible pay types that a job can be assigned. */ export class JobAssignmentPayType {} /** * Request object for fetching all `BankAccount` objects linked to a account. */ export class ListBankAccountsRequest { /** * The pagination cursor returned by a previous call to this endpoint. * Use it in the next `ListBankAccounts` request to retrieve the next set of results. * See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; /** * Upper limit on the number of bank accounts to return in the response. Currently, 1000 is the largest supported limit. * You can specify a limit of up to 1000 bank accounts. This is also the default limit. */ limit?: number | undefined; /** * Location ID. You can specify this optional filter to retrieve only the linked bank accounts belonging to a specific location. */ location_id?: string | undefined; } /** * Response object returned by ListBankAccounts. */ export class ListBankAccountsResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * List of BankAccounts associated with this account. */ bank_accounts?: BankAccount[] | undefined; /** * When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch next set of bank accounts. * If empty, this is the final response. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; } /** * A request for a filtered set of `BreakType` objects */ export class ListBreakTypesRequest { /** * Filter Break Types returned to only those that are associated with the specified location. */ location_id?: string | undefined; /** * Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200. */ limit?: number | undefined; /** * Pointer to the next page of Break Type results to fetch. */ cursor?: string | undefined; } /** * The response to a request for a set of `BreakTypes`. Contains the requested `BreakType` objects. * May contain a set of `Error` objects if the request resulted in errors. */ export class ListBreakTypesResponse { /** * A page of `BreakType` results. */ break_types?: BreakType[] | undefined; /** * Value supplied in the subsequent request to fetch the next next page of Break Type results. */ cursor?: string | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class ListCashDrawerShiftEventsRequest { /** * The ID of the location to list cash drawer shifts for. */ location_id: string; /** * Number of resources to be returned in a page of results (200 by default, 1000 max). */ limit?: number | undefined; /** * Opaque cursor for fetching the next page of results. */ cursor?: string | undefined; } export class ListCashDrawerShiftEventsResponse { /** * All of the events (payments, refunds, etc.) for a cash drawer during the shift. */ events?: CashDrawerShiftEvent[] | undefined; /** * Opaque cursor for fetching the next page. Cursor is not present in the last page of results. */ cursor?: string | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class ListCashDrawerShiftsRequest { /** * The ID of the location to query for a list of cash drawer shifts. */ location_id: string; /** * The order in which cash drawer shifts are listed in the response, based on their opened_at field. * Default value: ASC See [SortOrder](#type-sortorder) for possible values. */ sort_order?: string | undefined; /** * The inclusive start time of the query on opened_at, in ISO 8601 format. */ begin_time?: string | undefined; /** * The exclusive end date of the query on opened_at, in ISO 8601 format. */ end_time?: string | undefined; /** * Number of cash drawer shift events in a page of results (200 by default, 1000 max). */ limit?: number | undefined; /** * Opaque cursor for fetching the next page of results. */ cursor?: string | undefined; } export class ListCashDrawerShiftsResponse { /** * A collection of CashDrawerShiftSummary objects for shifts that match the query. */ items?: CashDrawerShiftSummary[] | undefined; /** * Opaque cursor for fetching the next page of results. Cursor is not present in the last page of results. */ cursor?: string | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class ListCatalogRequest { /** * TThe pagination cursor returned in the previous response. Leave unset for an initial request. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; /** * An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. */ types?: | "ITEM" | "ITEM_VARIATION" | "CATEGORY" | "DISCOUNT" | "TAX" | "MODIFIER" | "MODIFIER_LIST" | "IMAGE" | undefined; } export class ListCatalogResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The pagination cursor to be used in a subsequent request. If unset, this is the final response. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; /** * The CatalogObjects returned. */ objects?: CatalogObject[] | undefined; } /** * Defines the query parameters that can be provided in a request to the [ListCustomerGroups](#endpoint-listcustomergroups) endpoint. */ export class ListCustomerGroupsRequest { /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. */ cursor?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the [ListCustomerGroups](#endpoint-listcustomergroups) endpoint. * One of `errors` or `groups` is present in a given response (never both). */ export class ListCustomerGroupsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * A list of customer groups belonging to the current merchant. */ groups?: CustomerGroup[] | undefined; /** * A pagination cursor to retrieve the next set of results for your original query to the endpoint. * This value is present only if the request succeeded and additional results are available. * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. */ cursor?: string | undefined; } /** * Defines the valid parameters for requests to __ListCustomerSegments__. */ export class ListCustomerSegmentsRequest { /** * A pagination cursor returned by previous calls to __ListCustomerSegments__. Used to retrieve the next set of query results. * See the [Pagination guide](https://developer.squareup.com/docs/docs/working-with-apis/pagination) for more information. */ cursor?: string | undefined; } /** * Defines the fields included in the response body for requests to __ListCustomerSegments__. * One of `errors` or `segments` is present in a given response (never both). */ export class ListCustomerSegmentsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The list of customer segments belonging to the associated Square account. */ segments?: CustomerSegment[] | undefined; /** * A pagination cursor to be used in subsequent calls to __ListCustomerSegments__ to retrieve the next set of query results. * Only present only if the request succeeded and additional results are available. * See the [Pagination guide](https://developer.squareup.com/docs/docs/working-with-apis/pagination) for more information. */ cursor?: string | undefined; } /** * Defines the query parameters that can be provided in a request to the ListCustomers endpoint. */ export class ListCustomersRequest { /** * A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. */ cursor?: string | undefined; /** * Indicates how Customers should be sorted. Default: `DEFAULT`. * See [CustomerSortField](#type-customersortfield) for possible values. */ sort_field?: string | undefined; /** * Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. * See [SortOrder](#type-sortorder) for possible values. */ sort_order?: SortOrderType | undefined; } /** * Defines the fields that are included in the response body of a request to the ListCustomers endpoint. * One of `errors` or `customers` is present in a given response (never both). */ export class ListCustomersResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * An array of `Customer` objects that match the provided query. */ customers?: Customer[] | undefined; /** * A pagination cursor to retrieve the next set of results for the original query. * Only present if the request succeeded and additional results are available. * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. */ cursor?: string | undefined; } export class ListDeviceCodesRequest { /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * See [Paginating results](#paginatingresults) for more information. */ cursor?: string | undefined; /** * If specified, only returns DeviceCodes of the specified location. Returns DeviceCodes of all locations if empty. */ location_id?: string | undefined; /** * If specified, only returns DeviceCodes targeting the specified product type. * Returns DeviceCodes of all product types if empty. See [ProductType](#type-producttype) for possible values. */ product_type?: string | undefined; /** * If specified, returns DeviceCodes with the specified statuses. Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. * See [DeviceCodeStatus](#type-devicecodestatus) for possible values */ status?: string[] | undefined; } export class ListDeviceCodesResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The queried DeviceCode. */ device_codes?: DeviceCode[] | undefined; /** * A pagination cursor to retrieve the next set of results for your original query to the endpoint. * This value is present only if the request succeeded and additional results are available. * See [Paginating results](#paginatingresults) for more information. */ cursor?: string | undefined; } /** * Defines parameters for a ListDisputeEvidence request. */ export class ListDisputeEvidenceRequest {} /** * Defines fields in a ListDisputeEvidence response. */ export class ListDisputeEvidenceResponse { /** * The list of evidence previously uploaded to the specified dispute. */ evidence?: DisputeEvidence[] | undefined; /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; } /** * Defines request parameters for the ListDisputes endpoint. */ export class ListDisputesRequest { /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. * For more information, see [Paginating](https://developer.squareup.com/docs/basics/api101/pagination). */ cursor?: string | undefined; /** * The dispute states to filter the result. If not specified, the endpoint returns all open disputes (dispute status * is not `INQUIRY_CLOSED`, `WON`, or `LOST`). See [DisputeState](#type-disputestate) for possible values. */ states?: string[] | undefined; /** * The ID of the location for which to return a list of disputes. If not specified, the endpoint returns all open * disputes (dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`) associated with all locations. */ location_id?: string | undefined; } /** * Defines fields in a ListDisputes response. */ export class ListDisputesResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The list of Disputes. */ disputes?: Dispute[] | undefined; /** * The pagination cursor to be used in a subsequent request. If unset, this is the final response. * For more information, see [Paginating](https://developer.squareup.com/docs/basics/api101/pagination). */ cursor?: string | undefined; } /** * A request for a set of `EmployeeWage` objects */ export class ListEmployeeWagesRequest { /** * Filter wages returned to only those that are associated with the specified employee. */ employee_id?: string | undefined; /** * Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at * 200. */ limit?: number | undefined; /** * Pointer to the next page of Employee Wage results to fetch. */ cursor?: string | undefined; } /** * The response to a request for a set of `EmployeeWage` objects. Contains a set of `EmployeeWage`. */ export class ListEmployeeWagesResponse { /** * A page of Employee Wage results. */ employee_wages?: EmployeeWage[] | undefined; /** * Value supplied in the subsequent request to fetch the next next page of Employee Wage results. */ cursor?: string | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Retrieve a paged-list of employees for a Square account */ export class ListEmployeesRequest { /** * Filter employees returned to only those that are associated with the specified location. */ location_id?: string | undefined; /** * Specifies the EmployeeStatus to filter the employee by. See [EmployeeStatus](#type-employeestatus) for possible values. */ status?: ActivityStatusType | undefined; /** * The number of employees to be returned on each page. */ limit?: number | undefined; /** * The token required to retrieve the specified page of results. */ cursor?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the ListEmployees endpoint. * One of `errors` or `employees` is present in a given response (never both). */ export class ListEmployeesResponse { /** * List of employees returned from the request. */ employees?: Employee[] | undefined; /** * The token to be used to retrieve the next page of results. */ cursor?: string | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Describes a `ListInvoice` request. */ export class ListInvoicesRequest { /** * The ID of the location for which to list invoices. */ location_id: string; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this cursor to retrieve the next set of results for your original query. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; /** * The maximum number of invoices to return (200 is the maximum `limit`). * If not provided, the server uses a default limit of 100 invoices. */ limit?: number | undefined; } /** * Describes a `ListInvoice` response. */ export class ListInvoicesResponse { /** * The invoices retrieved. */ invoices?: Invoice[] | undefined; /** * When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of invoices. * If empty, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; } /** * Defines the fields that are included in requests to the __ListLocations__ endpoint. */ export class ListLocationsRequest {} /** * Defines the fields that are included in the response body of a request to the __ListLocations__ endpoint. * One of `errors` or `locations` is present in a given response (never both). */ export class ListLocationsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The business locations. */ locations?: Location[] | undefined; } /** * A request to list `LoyaltyProgram`. */ export class ListLoyaltyProgramsRequest {} /** * A response that contains all loyalty programs. */ export class ListLoyaltyProgramsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * A list of `LoyaltyProgram` for the merchant. */ programs?: LoyaltyProgram[] | undefined; } /** * Request object for the [ListMerchant](#endpoint-listmerchant) endpoint. */ export class ListMerchantsRequest { /** * The cursor generated by the previous response. */ cursor?: number | undefined; } /** * The response object returned by the [ListMerchant](#endpoint-listmerchant) endpoint. */ export class ListMerchantsResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested `Merchant` entities. */ merchant?: Merchant[] | undefined; /** * If the response is truncated, the cursor to use in next request to fetch next set of objects. */ cursor?: number | undefined; } /** * Retrieves a list of refunds for the account making the request. Max results per page: 100 */ export class ListPaymentRefundsRequest { /** * Timestamp for the beginning of the requested reporting period, in RFC 3339 format. * Default: The current time minus one year. */ begin_time?: string | undefined; /** * Timestamp for the end of the requested reporting period, in RFC 3339 format. Default: The current time. */ end_time?: string | undefined; /** * The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). */ sort_order?: SortOrderType | undefined; /** * A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; /** * Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. */ location_id?: string | undefined; /** * If provided, only refunds with the given status are returned. For a list of refund status values, see `PaymentRefund`. * Default: If omitted refunds are returned regardless of status. */ status?: string | undefined; /** * If provided, only refunds with the given source type are returned. * - `CARD` - List refunds only for payments where card was specified as payment source. * Default: If omitted refunds are returned regardless of source type. */ source_type?: string | undefined; /** * Maximum number of results to be returned in a single page. * It is possible to receive fewer results than the specified limit on a given page. * If the supplied value is greater than 100, at most 100 results will be returned. Default: `100` */ limit?: number | undefined; } /** * Defines the fields that are included in the response body of a request to the [ListPaymentRefunds](#endpoint-refunds-listpaymentrefunds) endpoint. * One of `errors` or `refunds` is present in a given response (never both). */ export class ListPaymentRefundsResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The list of requested refunds. */ refunds?: PaymentRefund[] | undefined; /** * The pagination cursor to be used in a subsequent request. If empty, this is the final response. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; } /** * Retrieves a list of payments taken by the account making the request. The maximum results per page is 100. */ export class ListPaymentsRequest { /** * The timestamp for the beginning of the reporting period, in RFC 3339 format. Inclusive. Default: The current time minus one year. */ begin_time?: string | undefined; /** * The timestamp for the end of the reporting period, in RFC 3339 format. Default: The current time. */ end_time?: string | undefined; /** * The order in which results are listed: - `ASC` - Oldest to newest. - `DESC` - Newest to oldest (default). */ sort_order?: string | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this cursor to retrieve the next set of results for the original query. * For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). */ cursor?: string | undefined; /** * Limit results to the location supplied. * By default, results are returned for the default (main) location associated with the seller. */ location_id?: string | undefined; /** * The exact amount in the `total_money` for a payment. */ total?: number | undefined; /** * The last four digits of a payment card. */ last_4?: string | undefined; /** * The brand of the payment card (for example, VISA). */ card_brand?: CardBrandType | undefined; /** * The maximum number of results to be returned in a single page. * It is possible to receive fewer results than the specified limit on a given page. * The default value of 100 is also the maximum allowed value. If the provided value is greater than 100, it is * ignored and the default value is used instead. Default: `100` */ limit?: number | undefined; } /** * Defines the fields that are included in the response body of a request to the [ListPayments](#endpoint-payments-listpayments) endpoint. */ export class ListPaymentsResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested list of payments. */ payments?: Payment[] | undefined; /** * The pagination cursor to be used in a subsequent request. If empty, this is the final response. * For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). */ cursor?: string | undefined; } /** * Defines the query parameters that can be included in a request to the ListRefunds endpoint. */ export class ListRefundsRequest { /** * The beginning of the requested reporting period, in RFC 3339 format. * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. * Default value: The current time minus one year. */ begin_time?: string | undefined; /** * The end of the requested reporting period, in RFC 3339 format. * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. */ end_time?: string | undefined; /** * The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). * Default value: `DESC` See [SortOrder](#type-sortorder) for possible values */ sort_order?: SortOrderType | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * See [Paginating results](#paginatingresults) for more information. */ cursor?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the [ListRefunds](#endpoint-listrefunds) endpoint. * One of `errors` or `refunds` is present in a given response (never both). */ export class ListRefundsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * An array of refunds that match your query. */ refunds?: Refund[] | undefined; /** * A pagination cursor for retrieving the next set of results, if any remain. * Provide this value as the `cursor` parameter in a subsequent request to this endpoint. * See [Paginating results](#paginatingresults) for more information. */ cursor?: string | undefined; } /** * Defines parameters in a [ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) endpoint request. */ export class ListSubscriptionEventsRequest { /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; /** * The upper limit on the number of subscription events to return in the response. Default: `200` */ limit?: number | undefined; } /** * Defines the fields that are included in the response from the [ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) endpoint. */ export class ListSubscriptionEventsResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The `SubscriptionEvents` retrieved. */ subscription_events?: SubscriptionEvent[] | undefined; /** * When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of events. * If empty, this is the final response. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; } /** * A request for a set of `TeamMemberWage` objects */ export class ListTeamMemberWagesRequest { /** * Filter wages returned to only those that are associated with the specified team member. */ team_member_id?: string | undefined; /** * Maximum number of Team Member Wages to return per page. Can range between 1 and 200. The default is the maximum at 200. */ limit?: number | undefined; /** * Pointer to the next page of Employee Wage results to fetch. */ cursor?: string | undefined; } /** * The response to a request for a set of `TeamMemberWage` objects. Contains a set of `TeamMemberWage`. */ export class ListTeamMemberWagesResponse { /** * A page of Team Member Wage results. */ team_member_wages?: TeamMemberWage[] | undefined; /** * Value supplied in the subsequent request to fetch the next next page of Team Member Wage results. */ cursor?: string | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines the query parameters that can be included in a request to the [ListTransactions](#endpoint-listtransactions) endpoint. * @deprecated recommend using [SearchOrders](#endpoint-orders-searchorders). */ export class ListTransactionsRequest { /** * The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details * on date inclusivity/exclusivity. Default value: The current time minus one year. */ begin_time?: string | undefined; /** * The end of the requested reporting period, in RFC 3339 format. * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. */ end_time?: string | undefined; /** * The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). * Default value: `DESC` See [SortOrder](#type-sortorder) for possible values. */ sort_order?: SortOrderType | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * See [Paginating results](#paginatingresults) for more information. */ cursor?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the [ListTransactions](#endpoint-listtransactions) endpoint. * One of `errors` or `transactions` is present in a given response (never both). */ export class ListTransactionsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * An array of transactions that match your query. */ transactions?: Transaction[] | undefined; /** * A pagination cursor for retrieving the next set of results, if any remain. * Provide this value as the `cursor` parameter in a subsequent request to this endpoint. * See [Paginating results](#paginatingresults) for more information. */ cursor?: string | undefined; } /** * A request for a set of `WorkweekConfig` objects */ export class ListWorkweekConfigsRequest { /** * Maximum number of Workweek Configs to return per page. */ limit?: number | undefined; /** * Pointer to the next page of Workweek Config results to fetch. */ cursor?: string | undefined; } /** * The response to a request for a set of `WorkweekConfig` objects. Contains the requested `WorkweekConfig` objects. * May contain a set of `Error` objects if the request resulted in errors. */ export class ListWorkweekConfigsResponse { /** * A page of Employee Wage results. */ workweek_configs?: WorkweekConfig[] | undefined; /** * Value supplied in the subsequent request to fetch the next page of Employee Wage results. */ cursor?: string | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Represents one of a business's locations. */ export class Location { /** * The Square-issued ID of the location. */ id?: string | undefined; /** * The name of the location. This information appears in the dashboard as the nickname. */ name?: string | undefined; /** * The physical address of the location. */ address?: Address | undefined; /** * The [IANA Timezone](https://www.iana.org/time-zones) identifier for the timezone of the location. */ timezone?: string | undefined; /** * The Square features that are enabled for the location. See `LocationCapability` for possible values. * See [LocationCapability](#type-locationcapability) for possible values */ capabilities?: string[] | undefined; /** * The status of the location, either active or inactive. See [LocationStatus](#type-locationstatus) for possible values. */ status?: ActivityStatusType | undefined; /** * The time when the location was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The ID of the merchant that owns the location. */ merchant_id?: string | undefined; /** * The country of the location, in ISO 3166-1-alpha-2 format. See `Country` for possible values. * See [Country](#type-country) for possible values */ country?: CountryType | undefined; /** * The language associated with the location, in [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). */ language_code?: string | undefined; /** * The currency used for all transactions at this location, in ISO 4217 format. See `Currency` for possible values. * See [Currency](#type-currency) for possible values. */ currency?: CurrencyType | undefined; /** * The phone number of the location in human readable format. */ phone_number?: string | undefined; /** * The business name of the location This is the name visible to the customers of the location. * For example, this name appears on customer receipts. */ business_name?: string | undefined; /** * The type of the location, either physical or mobile. See [LocationType](#type-locationtype) for possible values */ type?: "PHYSICAL" | "MOBILE" | undefined; /** * The website URL of the location. */ website_url?: string | undefined; /** * Represents the hours of operation for the location. */ business_hours?: BusinessHours | undefined; /** * The email of the location. This email is visible to the customers of the location. For example, the email appears on customer receipts. */ business_email?: string | undefined; /** * The description of the location. */ description?: string | undefined; /** * The Twitter username of the location without the '@' symbol. */ twitter_username?: string | undefined; /** * The Instagram username of the location without the '@' symbol. */ instagram_username?: string | undefined; /** * The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. */ facebook_url?: string | undefined; /** * The physical coordinates (latitude and longitude) of the location. */ coordinates?: Coordinates | undefined; /** * The URL of the logo image for the location. The Seller must choose this logo in the Seller dashboard (Receipts section) * for the logo to appear on transactions (such as receipts, invoices) that Square generates on behalf of the Seller. * This image should have an aspect ratio close to 1:1 and is recommended to be at least 200x200 pixels. */ logo_url?: string | undefined; /** * The URL of the Point of Sale background image for the location. */ pos_background_url?: string | undefined; /** * The merchant category code (MCC) of the location, as standardized by ISO 18245. * The MCC describes the kind of goods or services sold at the location. */ mcc?: string | undefined; /** * The URL of a full-format logo image for the location. * The Seller must choose this logo in the Seller dashboard (Receipts section) for the logo to appear on * transactions (such as receipts, invoices) that Square generates on behalf of the Seller. * This image can have an aspect ratio of 2:1 or greater and is recommended to be at least 1280x648 pixels. */ full_format_logo_url?: string | undefined; } /** * The capabilities a location may have. */ export class LocationCapability {} /** * The status of the location, whether a location is active or inactive. */ export class LocationStatus {} /** * A location's physical or mobile type. */ export class LocationType {} /** * Describes a loyalty account. For more information, see [Loyalty Overview](/docs/loyalty/overview). */ export class LoyaltyAccount { /** * The Square-assigned ID of the loyalty account. */ id?: string | undefined; /** * The list of mappings that the account is associated with. * Currently, a buyer can only be mapped to a loyalty account using a phone number. * Therefore, the list can only have one mapping. */ mappings: LoyaltyAccountMapping[]; /** * The Square-assigned ID of the `loyalty program` to which the account belongs. */ program_id: string; /** * The available point balance in the loyalty account. * Your application should be able to handle loyalty accounts that have a negative point balance (`balance` is less than 0). * This might occur if a seller makes a manual adjustment or as a result of a refund or exchange. */ balance?: number | undefined; /** * The total points accrued during the lifetime of the account. */ lifetime_points?: number | undefined; /** * The Square-assigned ID of the `customer` that is associated with the account. */ customer_id?: string | undefined; /** * The timestamp when enrollment occurred, in RFC 3339 format. */ enrolled_at?: string | undefined; /** * The timestamp when the loyalty account was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The timestamp when the loyalty account was last updated, in RFC 3339 format. */ updated_at?: string | undefined; } /** * Associates a loyalty account with the buyer's phone number. For more information, see [Loyalty Overview](/docs/loyalty/overview). */ export class LoyaltyAccountMapping { /** * The Square-assigned ID of the mapping. */ id?: string | undefined; /** * The type of mapping. See [LoyaltyAccountMappingType](#type-loyaltyaccountmappingtype) for possible values. */ type: string; /** * The phone number, in E.164 format. For example, \"+14155551111\". */ value: string; /** * The timestamp when the mapping was created, in RFC 3339 format. */ created_at?: string | undefined; } /** * The type of mapping. */ export class LoyaltyAccountMappingType {} /** * Provides information about a loyalty event. For more information, see [Loyalty events](/docs/loyalty-api/overview/#loyalty-events). */ export class LoyaltyEvent { /** * The Square-assigned ID of the loyalty event. */ id: string; /** * The type of the loyalty event. See [LoyaltyEventType](#type-loyaltyeventtype) for possible values. */ type: string; /** * The timestamp when the event was created, in RFC 3339 format. */ created_at: string; /** * Provides metadata when the event `type` is `ACCUMULATE_POINTS`. */ accumulate_points?: LoyaltyEventAccumulatePoints | undefined; /** * Provides metadata when the event `type` is `CREATE_REWARD`. */ create_reward?: LoyaltyEventCreateReward | undefined; /** * Provides metadata when the event `type` is `REDEEM_REWARD`. */ redeem_reward?: LoyaltyEventRedeemReward | undefined; /** * Provides metadata when the event `type` is `DELETE_REWARD`. */ delete_reward?: LoyaltyEventDeleteReward | undefined; /** * Provides metadata when the event `type` is `ADJUST_POINTS`. */ adjust_points?: LoyaltyEventAdjustPoints | undefined; /** * The ID of the `loyalty account` in which the event occurred. */ loyalty_account_id: string; /** * The ID of the `location` where the event occurred. */ location_id?: string | undefined; /** * Defines whether the event was generated by the Square Point of Sale. * See [LoyaltyEventSource](#type-loyaltyeventsource) for possible values. */ source: string; /** * Provides metadata when the event `type` is `EXPIRE_POINTS`. */ expire_points?: LoyaltyEventExpirePoints | undefined; /** * Provides metadata when the event `type` is `OTHER`. */ other_event?: LoyaltyEventOther | undefined; } /** * Provides metadata when the event `type` is `ACCUMULATE_POINTS`. */ export class LoyaltyEventAccumulatePoints { /** * The ID of the `loyalty program`. */ loyalty_program_id?: string | undefined; /** * The number of points accumulated by the event. */ points?: number | undefined; /** * The ID of the `order` for which the buyer accumulated the points. * This field is returned only if the Orders API is used to process orders. */ order_id?: string | undefined; } /** * Provides metadata when the event `type` is `ADJUST_POINTS`. */ export class LoyaltyEventAdjustPoints { /** * The Square-assigned ID of the `loyalty program`. */ loyalty_program_id?: string | undefined; /** * The number of points added or removed. */ points: number; /** * The reason for the adjustment of points. */ reason?: string | undefined; } /** * Provides metadata when the event `type` is `CREATE_REWARD`. */ export class LoyaltyEventCreateReward { /** * The ID of the `loyalty program`. */ loyalty_program_id: string; /** * The Square-assigned ID of the created `loyalty reward`. This field is returned only if the event source is `LOYALTY_API`. */ reward_id?: string | undefined; /** * The loyalty points used to create the reward. */ points: number; } /** * Filter events by date time range. */ export class LoyaltyEventDateTimeFilter { /** * The `created_at` date time range used to filter the result. */ created_at: TimeRange; } /** * Provides metadata when the event `type` is `DELETE_REWARD`. */ export class LoyaltyEventDeleteReward { /** * The ID of the `loyalty program`. */ loyalty_program_id: string; /** * The ID of the deleted `loyalty reward`. This field is returned only if the event source is `LOYALTY_API`. */ reward_id?: string | undefined; /** * The number of points returned to the loyalty account. */ points: number; } /** * Provides metadata when the event `type` is `EXPIRE_POINTS`. */ export class LoyaltyEventExpirePoints { /** * The Square-assigned ID of the `loyalty program`. */ loyalty_program_id: string; /** * The number of points expired. */ points: number; } /** * The filtering criteria. If the request specifies multiple filters, the endpoint uses a logical AND to evaluate them. */ export class LoyaltyEventFilter { /** * Filter events by loyalty account. */ loyalty_account_filter?: LoyaltyEventLoyaltyAccountFilter | undefined; /** * Filter events by event type. */ type_filter?: LoyaltyEventTypeFilter | undefined; /** * Filter events by date time range. For each range, the start time is inclusive and the end time is exclusive. */ date_time_filter?: LoyaltyEventDateTimeFilter | undefined; /** * Filter events by location. */ location_filter?: LoyaltyEventLocationFilter | undefined; /** * Filter events by the order associated with the event. */ order_filter?: LoyaltyEventOrderFilter | undefined; } /** * Filter events by location. */ export class LoyaltyEventLocationFilter { /** * The `location` IDs for loyalty events to query. * If multiple values are specified, the endpoint uses a logical OR to combine them. */ location_ids: string[]; } /** * Filter events by loyalty account. */ export class LoyaltyEventLoyaltyAccountFilter { /** * The ID of the `loyalty account` associated with loyalty events. */ loyalty_account_id: string; } /** * Filter events by the order associated with the event. */ export class LoyaltyEventOrderFilter { /** * The ID of the `order` associated with the event. */ order_id: string; } /** * Provides metadata when the event `type` is `OTHER`. */ export class LoyaltyEventOther { /** * The Square-assigned ID of the `loyalty program`. */ loyalty_program_id: string; /** * The number of points added or removed. */ points: number; } /** * Represents a query used to search for loyalty events. */ export class LoyaltyEventQuery { /** * The query filter criteria. */ filter?: LoyaltyEventFilter | undefined; } /** * Provides metadata when the event `type` is `REDEEM_REWARD`. */ export class LoyaltyEventRedeemReward { /** * The ID of the `loyalty program`. */ loyalty_program_id: string; /** * The ID of the redeemed `loyalty reward`. This field is returned only if the event source is `LOYALTY_API`. */ reward_id?: string | undefined; /** * The ID of the `order` that redeemed the reward. * This field is returned only if the Orders API is used to process orders. */ order_id?: string | undefined; } /** * Defines whether the event was generated by the Square Point of Sale. */ export class LoyaltyEventSource {} /** * The type of the loyalty event. */ export class LoyaltyEventType {} /** * Filter events by event type. */ export class LoyaltyEventTypeFilter { /** * The loyalty event types used to filter the result. If multiple values are specified, the endpoint uses a logical OR to combine them. * See [LoyaltyEventType](#type-loyaltyeventtype) for possible values. */ types: string[]; } export class LoyaltyProgram { /** * The Square-assigned ID of the loyalty program. Updates to the loyalty program do not modify the identifier. */ id: string; /** * Whether the program is currently active. See [LoyaltyProgramStatus](#type-loyaltyprogramstatus) for possible values */ status: string; /** * The list of rewards for buyers, sorted by ascending points. */ reward_tiers: LoyaltyProgramRewardTier[]; /** * If present, details for how points expire. */ expiration_policy?: LoyaltyProgramExpirationPolicy | undefined; /** * A cosmetic name for the “points” currency. */ terminology: LoyaltyProgramTerminology; /** * The `locations` at which the program is active. */ location_ids: string[]; /** * The timestamp when the program was created, in RFC 3339 format. */ created_at: string; /** * The timestamp when the reward was last updated, in RFC 3339 format. */ updated_at: string; /** * Defines how buyers can earn loyalty points. */ accrual_rules: LoyaltyProgramAccrualRule[]; } /** * Defines an accrual rule, which is how buyers can earn points. */ export class LoyaltyProgramAccrualRule { /** * The type of the accrual rule that defines how buyers can earn points. * See [LoyaltyProgramAccrualRuleType](#type-loyaltyprogramaccrualruletype) for possible values. */ accrual_type: string; /** * The number of points that buyers earn based on the `accrual_type`. */ points?: number | undefined; /** * When the accrual rule is visit-based (`accrual_type` is `VISIT`), this field indicates the minimum purchase * required during the visit to quality for the reward. */ visit_minimum_amount_money?: Money | undefined; /** * When the accrual rule is spend-based (`accrual_type` is `SPEND`), this field indicates the amount that a buyer must spend * to earn the points. For example, suppose the accrual rule is \"earn 1 point for every $10 you spend\". * Then, buyer earns a point for every $10 they spend. If buyer spends $105, the buyer earns 10 points. */ spend_amount_money?: Money | undefined; /** * The ID of the `catalog object` to purchase to earn the number of points defined by the rule. * This is either an item variation or a category, depending on the type. This is defined on `ITEM_VARIATION` rules and `CATEGORY` rules. */ catalog_object_id?: string | undefined; } /** * The type of the accrual rule that defines how buyers can earn points. */ export class LoyaltyProgramAccrualRuleType {} /** * Describes when the loyalty program expires. */ export class LoyaltyProgramExpirationPolicy { /** * The duration of time before points expire, in RFC 3339 format. */ expiration_duration: string; } /** * Provides details about the loyalty program reward tier definition. */ export class LoyaltyProgramRewardDefinition { /** * Indicates the scope of the reward tier. * See [LoyaltyProgramRewardDefinitionScope](#type-loyaltyprogramrewarddefinitionscope) for possible values. */ scope: string; /** * The type of discount the reward tier offers. * See [LoyaltyProgramRewardDefinitionType](#type-loyaltyprogramrewarddefinitiontype) for possible values. */ discount_type: string; /** * Present if `discount_type` is `FIXED_PERCENTAGE`. For example, a 7.25% off discount will be represented as \"7.25\". */ percentage_discount?: string | undefined; /** * A list of `catalog object` ids to which this reward can be applied. * They are either all item-variation ids or category ids, depending on the `type` field. */ catalog_object_ids?: string[] | undefined; /** * Present if `discount_type` is `FIXED_AMOUNT`. For example, $5 off. */ fixed_discount_money?: Money | undefined; /** * When `discount_type` is `FIXED_PERCENTAGE`, the maximum discount amount that can be applied. */ max_discount_money?: Money | undefined; } /** * Indicates the scope of the reward tier. */ export class LoyaltyProgramRewardDefinitionScope {} /** * The type of discount the reward tier offers. */ export class LoyaltyProgramRewardDefinitionType {} /** * Describes a loyalty program reward tier. */ export class LoyaltyProgramRewardTier { /** * The Square-assigned ID of the reward tier. */ id: string; /** * The points exchanged for the reward tier. */ points: number; /** * The name of the reward tier. */ name: string; /** * Provides details about the reward tier definition. */ definition: LoyaltyProgramRewardDefinition; /** * The timestamp when the reward tier was created, in RFC 3339 format. */ created_at: string; } /** * Whether the program is currently active. */ export class LoyaltyProgramStatus {} export class LoyaltyProgramTerminology { /** * A singular unit for a point (for example, 1 point is called 1 star). */ one: string; /** * A plural unit for point (for example, 10 points is called 10 stars). */ other: string; } export class LoyaltyReward { /** * The Square-assigned ID of the loyalty reward. */ id?: string | undefined; /** * The status of a loyalty reward. See [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible values. */ status?: string | undefined; /** * The Square-assigned ID of the `loyalty account` to which the reward belongs. */ loyalty_account_id: string; /** * The Square-assigned ID of the `reward tier` used to create the reward. */ reward_tier_id: string; /** * The number of loyalty points used for the reward. */ points?: number | undefined; /** * The Square-assigned ID of the `order` to which the reward is attached. */ order_id?: string | undefined; /** * The timestamp when the reward was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The timestamp when the reward was last updated, in RFC 3339 format. */ updated_at?: string | undefined; /** * The timestamp when the reward was redeemed, in RFC 3339 format. */ redeemed_at?: string | undefined; } /** * The status of the loyalty reward. */ export class LoyaltyRewardStatus {} /** * 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 class MeasurementUnit { /** * A custom unit of measurement defined by the seller using the Point of Sale app or ad-hoc as an order line item. */ custom_unit?: MeasurementUnitCustom | undefined; /** * Represents a standard area unit. See [MeasurementUnitArea](#type-measurementunitarea) for possible values. */ area_unit?: AreaUnitType | undefined; /** * Represents a standard length unit. See [MeasurementUnitLength](#type-measurementunitlength) for possible values. */ length_unit?: LengthUnitType | undefined; /** * Represents a standard volume unit. See [MeasurementUnitVolume](#type-measurementunitvolume) for possible values. */ volume_unit?: VolumeUnitType | undefined; /** * Represents a standard unit of weight or mass. See [MeasurementUnitWeight](#type-measurementunitweight) for possible values. */ weight_unit?: WeightUnitType | undefined; /** * Reserved for API integrations that lack the ability to specify a real measurement unit. * See [MeasurementUnitGeneric](#type-measurementunitgeneric) for possible values. */ generic_unit?: string | undefined; /** * Represents a standard unit of time. See [MeasurementUnitTime](#type-measurementunittime) for possible values. */ time_unit?: string | undefined; /** * Represents the type of the measurement unit. * See [MeasurementUnitUnitType](#type-measurementunitunittype) for possible values. */ type?: string | undefined; } /** * Unit of area used to measure a quantity. */ export class MeasurementUnitArea {} /** * The information needed to define a custom unit, provided by the seller. */ export class MeasurementUnitCustom { /** * The name of the custom unit, for example "bushel". */ name: string; /** * The abbreviation of the custom unit, such as "bsh" (bushel). * This appears in the cart for the Point of Sale app, and in reports. */ abbreviation: string; } /** * A custom unit of measurement defined by the user. */ export class MeasurementUnitGeneric {} /** * The unit of length used to measure a quantity. */ export class MeasurementUnitLength {} /** * Unit of time used to measure a quantity (a duration). */ export class MeasurementUnitTime {} /** * Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. */ export class MeasurementUnitUnitType {} /** * The unit of volume used to measure a quantity. */ export class MeasurementUnitVolume {} /** * Unit of weight used to measure a quantity. */ export class MeasurementUnitWeight {} /** * Represents a Square seller. */ export class Merchant { /** * The Square-issued ID of the merchant. */ id?: string | undefined; /** * The business name of the merchant. */ business_name?: string | undefined; /** * The country code associated with the merchant account, in ISO 3166 format. See [Country](#type-country) for possible values. */ country: string; /** * The language code associated with the merchant account, in BCP 47 format. */ language_code?: string | undefined; /** * The currency associated with the merchant account, in ISO 4217 format. See [Currency](#type-currency) for possible values */ currency?: string | undefined; /** * The merchant status, active or inactive. See [MerchantStatus](#type-merchantstatus) for possible values */ status?: string | undefined; /** * The ID of the main `Location` for this merchant. */ main_location_id?: string | undefined; } export class MerchantStatus {} /** * A record of an employee's break during a shift. */ export class ModelBreak { /** * UUID for this object. */ id?: string | undefined; /** * RFC 3339; follows same timezone info as `Shift`. Precision up to the minute is respected; seconds are truncated. */ start_at: string; /** * RFC 3339; follows same timezone info as `Shift`. Precision up to the minute is respected; seconds are truncated. */ end_at?: string | undefined; /** * The `BreakType` this `Break` was templated on. */ break_type_id: string; /** * A human-readable name. */ name: string; /** * Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of the break. */ expected_duration: string; /** * Whether this break counts towards time worked for compensation purposes. */ is_paid: boolean; } /** * Represents an error encountered during a request to the Connect API. See [Handling errors](#handlingerrors) for more information. */ export class ModelError { /** * The high-level category for the error. See `ErrorCategory` for possible values. * See [ErrorCategory](#type-errorcategory) for possible values. */ category: ErrorCategoryType; /** * The specific code of the error. See `ErrorCode` for possible values See [ErrorCode](#type-errorcode) for possible values. */ code: ErrorCodeType; /** * A human-readable description of the error for debugging purposes. */ detail?: string | undefined; /** * The name of the field provided in the original request (if any) that the error pertains to. */ field?: string | undefined; } /** * 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](/build-basics/working-with-monetary-amounts) for more information. */ export class Money { /** * The amount of money, in the smallest denomination of the currency indicated by `currency`. * For example, when `currency` is `USD`, `amount` is in cents. Monetary amounts can be positive or negative. * See the specific field description to determine the meaning of the sign in a particular case. */ amount: number; /** * The type of currency, in __ISO 4217 format__. For example, the currency code for US dollars is `USD`. * See `Currency` for possible values. See [Currency](#type-currency) for possible values. */ currency: CurrencyType; } export class ObtainTokenRequest { /** * The Square-issued ID of your application, available from the [application dashboard](https://connect.squareup.com/apps). */ client_id: string; /** * The Square-issued application secret for your application, available from the * [application dashboard](https://connect.squareup.com/apps). */ client_secret: string; /** * The authorization code to exchange. This is required if `grant_type` is set to `authorization_code`, to indicate * that the application wants to exchange an authorization code for an OAuth access token. */ code?: string | undefined; /** * The redirect URL assigned in the [application dashboard](https://connect.squareup.com/apps). */ redirect_uri?: string | undefined; /** * Specifies the method to request an OAuth access token. * Valid values are: `authorization_code`, `refresh_token`, and `migration_token`. */ grant_type: string; /** * A valid refresh token for generating a new OAuth access token. A valid refresh token is required if `grant_type` * is set to `refresh_token`, to indicate the application wants a replacement for an expired OAuth access token. */ refresh_token?: string | undefined; /** * Legacy OAuth access token obtained using a Connect API version prior to 2019-03-13. This parameter is required * if `grant_type` is set to `migration_token` to indicate that the application wants to get a replacement OAuth access token. * The response also returns a refresh token. * For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/authz/oauth/migration). */ migration_token?: string | undefined; } export class ObtainTokenResponse { /** * A valid OAuth access token. OAuth access tokens are 64 bytes long. * Provide the access token in a header with every request to Connect API endpoints. * See the [Build with OAuth](https://developer.squareup.com/docs/authz/oauth/build-with-the-api) guide for more information. */ access_token?: string | undefined; /** * This value is always "bearer". */ token_type?: string | undefined; /** * The date when access_token expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. */ expires_at?: string | undefined; /** * The ID of the authorizing merchant's business. */ merchant_id?: string | undefined; /** * @deprecated The ID of a subscription plan the merchant signed up for. * Only present if the merchant signed up for a subscription during authorization. */ subscription_id?: string | undefined; /** * @deprecated The ID of the subscription plan the merchant signed up for. * Only present if the merchant signed up for a subscription during authorization. */ plan_id?: string | undefined; /** * Then OpenID token belonging to this this person. * Only present if the OPENID scope is included in the authorize request. */ id_token?: string | undefined; /** * A refresh token. OAuth refresh tokens are 64 bytes long. * For more information, see [OAuth access token management](https://developer.squareup.com/docs/authz/oauth/how-it-works#oauth-access-token-management). */ refresh_token?: string | undefined; } /** * 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 on any associated tenders, refunds, and returns. * All Connect V2 Transactions have all been converted to Orders including all associated itemization data. */ export class Order { /** * The order's unique ID. */ id?: string | undefined; /** * The ID of the merchant location this order is associated with. */ location_id?: string | undefined; /** * A client specified identifier to associate an entity in another system with this order. */ reference_id?: string | undefined; /** * The origination details of the order. */ source?: OrderSource | undefined; /** * The `Customer` ID of the customer associated with the order. */ customer_id?: string | undefined; /** * The line items included in the order. */ line_items?: OrderLineItem[] | undefined; /** * The list of all taxes associated with the order. Taxes can be scoped to either `ORDER` or `LINE_ITEM`. * For taxes with `LINE_ITEM` scope, an `OrderLineItemAppliedTax` must be added to each line item that the tax applies to. * For taxes with `ORDER` scope, the server will generate an `OrderLineItemAppliedTax` for every line item. * On reads, each tax in the list will include the total amount of that tax applied to the order. * @note If `LINE_ITEM` scope is set on any taxes in this field, usage of the deprecated `line_items.taxes` * field will result in an error. Please use `line_items.applied_taxes` instead. */ taxes?: OrderLineItemTax[] | undefined; /** * The list of all discounts associated with the order. Discounts can be scoped to either `ORDER` or `LINE_ITEM`. * For discounts scoped to `LINE_ITEM`, an `OrderLineItemAppliedDiscount` must be added to each line item that the * discount applies to. For discounts with `ORDER` scope, the server will generate an `OrderLineItemAppliedDiscount` * for every line item. * @note If `LINE_ITEM` scope is set on any discounts in this field, usage of the deprecated `line_items.discounts` * field will result in an error. Please use `line_items.applied_discounts` instead. */ discounts?: OrderLineItemDiscount[] | undefined; /** * A list of service charges applied to the order. */ service_charges?: OrderServiceCharge[] | undefined; /** * Details on order fulfillment. Orders can only be created with at most one fulfillment. * However, orders returned by the API may contain multiple fulfillments. */ fulfillments?: OrderFulfillment[] | undefined; /** * Collection of items from sale Orders being returned in this one. Normally part of an Itemized Return or Exchange. * There will be exactly one `Return` object per sale Order being referenced. */ returns?: OrderReturn[] | undefined; /** * Rollup of returned money amounts. */ return_amounts?: OrderMoneyAmounts | undefined; /** * Net money amounts (sale money - return money). */ net_amounts?: OrderMoneyAmounts | undefined; /** * A positive or negative rounding adjustment to the total of the order, commonly used to apply Cash Rounding when * the minimum unit of account is smaller than the lowest physical denomination of currency. */ rounding_adjustment?: OrderRoundingAdjustment | undefined; /** * The Tenders which were used to pay for the Order. */ tenders?: Tender[] | undefined; /** * The Refunds that are part of this Order. */ refunds?: Refund[] | undefined; /** * Application-defined data attached to this order. Metadata fields are intended to store descriptive references * or associations with an entity in another system or store brief information about the object. * Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to * store any sensitive information (personally identifiable information, card details, etc.). * Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. * Entries may also include metadata generated by Square. These keys are prefixed with a namespace, separated * from the key with a ':' character. Values have a max length of 255 characters. An application may have up to * 10 entries per metadata field. Entries written by applications are private and can only be read or modified by * the same application. See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. */ metadata?: { [key: string]: string } | undefined; /** * Timestamp for when the order was created. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". */ created_at?: string | undefined; /** * Timestamp for when the order was last updated. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". */ updated_at?: string | undefined; /** * Timestamp for when the order reached a terminal [state](#property-state). In RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". */ closed_at?: string | undefined; /** * The current state of the order. `OPEN`,`COMPLETED`,`CANCELED` See [OrderState](#type-orderstate) for possible values. */ state?: OrderStateType | undefined; /** * Version number which is incremented each time an update is committed to the order. Orders that were not created * through the API will not include a version and thus cannot be updated. * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders#update-orders). */ version?: number | undefined; /** * The total amount of money to collect for the order. */ total_money?: Money | undefined; /** * The total tax amount of money to collect for the order. */ total_tax_money?: Money | undefined; /** * The total discount amount of money to collect for the order. */ total_discount_money?: Money | undefined; /** * The total tip amount of money to collect for the order. */ total_tip_money?: Money | undefined; /** * The total amount of money collected in service charges for the order. * @note `total_service_charge_money` is the sum of `applied_money` fields for each individual service charge. * Therefore, `total_service_charge_money` will only include inclusive tax amounts, not additive tax amounts. */ total_service_charge_money?: Money | undefined; /** * 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 pre-configured * [pricing rules](https://developer.squareup.com/docs/reference/square/objects/CatalogPricingRule). */ pricing_options?: OrderPricingOptions | undefined; /** * A set-like list of rewards that have been added to the order. */ rewards?: OrderReward[] | undefined; } export class OrderCreated { /** * The order's unique ID. */ order_id?: string | undefined; /** * Version number which is incremented each time an update is committed to the order. * Orders that were not created through the API will not include a version and thus cannot be updated. * [Read more about working with versions](https://developer.squareup.com/docs/docs/orders-api/manage-orders#update-orders). */ version?: number | undefined; /** * The ID of the merchant location this order is associated with. */ location_id?: string | undefined; /** * The state of the order. See [OrderState](#type-orderstate) for possible values. */ state?: string | undefined; /** * Timestamp for when the order was created in RFC 3339 format. */ created_at?: string | undefined; } export class OrderCreatedObject { /** * Information about the created order. */ order_created?: OrderCreated | undefined; } /** * A lightweight description of an [Order](#type-order) that is returned when `returned_entries` is true * on a [SearchOrderRequest](#type-searchorderrequest). */ export class OrderEntry { /** * The id of the Order. */ order_id?: string | undefined; /** * Version number which is incremented each time an update is committed to the order. * Orders that were not created through the API will not include a version and thus cannot be updated. * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders#update-orders). */ version?: number | undefined; /** * The location id the Order belongs to. */ location_id?: string | undefined; } /** * Contains details on how to fulfill this order. */ export class OrderFulfillment { /** * Unique ID that identifies the fulfillment only within this order. */ uid?: string | undefined; /** * The type of the fulfillment. See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values. */ type?: FulfillmentType | undefined; /** * The state of the fulfillment. See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values. */ state?: FulfillmentStateType | undefined; /** * Application-defined data attached to this fulfillment. Metadata fields are intended to store descriptive * references or associations with an entity in another system or store brief information about the object. * Square does not process this field; it only stores and returns it in relevant API calls. * Do not use metadata to store any sensitive information (personally identifiable information, card details, etc.). * Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. * Entries may also include metadata generated by Square. These keys are prefixed with a namespace, separated from * the key with a ':' character. Values have a max length of 255 characters. An application may have up to 10 entries * per metadata field. Entries written by applications are private and can only be read or modified by the same application. * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. */ metadata?: { [key: string]: string } | undefined; /** * Contains details for a pickup fulfillment. Required when fulfillment type is `PICKUP`. */ pickup_details?: OrderFulfillmentPickupDetails | undefined; /** * Contains details for a shipment fulfillment. Required when fulfillment type is `SHIPMENT`. * A shipment fulfillment's relationship to fulfillment `state`: * `PROPOSED`: A shipment is requested. * `RESERVED`: Fulfillment accepted. Shipment processing. * `PREPARED`: Shipment packaged. Shipping label created. * `COMPLETED`: Package has been shipped. * `CANCELED`: Shipment has been canceled. * `FAILED`: Shipment has failed. */ shipment_details?: OrderFulfillmentShipmentDetails | undefined; } /** * Contains details necessary to fulfill a pickup order. */ export class OrderFulfillmentPickupDetails { /** * Information on the person meant to pick up this fulfillment from a physical location. */ recipient?: OrderFulfillmentRecipient | undefined; /** * The [timestamp](#workingwithdates) indicating when this fulfillment will expire if it is not accepted. * Must be in RFC 3339 format e.g., "2016-09-04T23:59:33.123Z". Expiration time can only be set up to 7 days in the future. * If `expires_at` is not set, this pickup fulfillment will be automatically accepted when placed. */ expires_at?: string | undefined; /** * The duration of time after which an open and accepted pickup fulfillment will automatically move to the `COMPLETED` state. * Must be in RFC3339 duration format e.g., "P1W3D". * If not set, this pickup fulfillment will remain accepted until it is canceled or completed. */ auto_complete_duration?: string | undefined; /** * The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`. * See [OrderFulfillmentPickupDetailsScheduleType](#type-orderfulfillmentpickupdetailsscheduletype) for possible values. */ schedule_type?: "SCHEDULED" | "ASAP" | undefined; /** * The [timestamp](#workingwithdates) that represents the start of the pickup window. * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". For fulfillments with the schedule type `ASAP`, * this is automatically set to the current time plus the expected duration to prepare the fulfillment. */ pickup_at?: string | undefined; /** * The window of time in which the order should be picked up after the `pickup_at` timestamp. * Must be in RFC3339 duration format, e.g., "P1W3D". Can be used as an informational guideline for merchants. */ pickup_window_duration?: string | undefined; /** * The duration of time it takes to prepare this fulfillment. Must be in RFC3339 duration format, e.g., "P1W3D". */ prep_time_duration?: string | undefined; /** * A note meant to provide additional instructions about the pickup fulfillment displayed in the Square Point of Sale and set by the API. */ note?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the fulfillment was placed. * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ placed_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the fulfillment was accepted. * In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ accepted_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the fulfillment was rejected. * In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ rejected_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the fulfillment is marked as ready for pickup. * In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ ready_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the fulfillment expired. * In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ expired_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the fulfillment was picked up by the recipient. * In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ picked_up_at?: string | undefined; /** * The [timestamp](#workingwithdates) in RFC3339 timestamp format. * e.g., "2016-09-04T23:59:33.123Z", indicating when the fulfillment was canceled. */ canceled_at?: string | undefined; /** * A description of why the pickup was canceled. Max length: 100 characters. */ cancel_reason?: string | undefined; /** * If true, indicates this pickup order is for curbside pickup, not in-store pickup. */ is_curbside_pickup?: boolean | undefined; /** * Specific details for curbside pickup. Can only be populated if `is_curbside_pickup` is true. */ curbside_pickup_details?: OrderFulfillmentPickupDetailsCurbsidePickupDetails | undefined; } /** * Specific details for curbside pickup. */ export class OrderFulfillmentPickupDetailsCurbsidePickupDetails { /** * Specific details for curbside pickup, such as parking number, vehicle model, etc. */ curbside_details?: string | undefined; /** * The [timestamp](#workingwithdates) in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", * indicating when the buyer arrived and is waiting for pickup. */ buyer_arrived_at?: string | undefined; } /** * Contains information on the recipient of a fulfillment. */ export class OrderFulfillmentRecipient { /** * The Customer ID of the customer associated with the fulfillment. * If `customer_id` is provided, the fulfillment recipient's `display_name`, `email_address`, and `phone_number` * are automatically populated from the targeted customer profile. If these fields are set in the request, * the request values will override the information from the customer profile. If the targeted customer profile * does not contain the necessary information and these fields are left unset, the request will result in an error. */ customer_id?: string | undefined; /** * The display name of the fulfillment recipient. * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. */ display_name?: string | undefined; /** * The email address of the fulfillment recipient. * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. */ email_address?: string | undefined; /** * The phone number of the fulfillment recipient. * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. */ phone_number?: string | undefined; /** * The address of the fulfillment recipient. * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. */ address?: Address | undefined; } /** * Contains details necessary to fulfill a shipment order. */ export class OrderFulfillmentShipmentDetails { /** * Information on the person meant to receive this shipment fulfillment. */ recipient?: OrderFulfillmentRecipient | undefined; /** * The shipping carrier being used to ship this fulfillment e.g. UPS, FedEx, USPS, etc. */ carrier?: string | undefined; /** * A note with additional information for the shipping carrier. */ shipping_note?: string | undefined; /** * A description of the type of shipping product purchased from the carrier. e.g. First Class, Priority, Express */ shipping_type?: string | undefined; /** * The reference number provided by the carrier to track the shipment's progress. */ tracking_number?: string | undefined; /** * A link to the tracking webpage on the carrier's website. */ tracking_url?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the shipment was requested. * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ placed_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when this fulfillment was moved to the `RESERVED` state. * Indicates that preparation of this shipment has begun. Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ in_progress_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when this fulfillment was moved to the `PREPARED` state. * Indicates that the fulfillment is packaged. Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ packaged_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the shipment is expected to be delivered to the shipping carrier. * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ expected_shipped_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when this fulfillment was moved to the `COMPLETED`state. * Indicates that the fulfillment has been given to the shipping carrier. * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ shipped_at?: string | undefined; /** * The [timestamp](#workingwithdates) indicating the shipment was canceled. * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ canceled_at?: string | undefined; /** * A description of why the shipment was canceled. */ cancel_reason?: string | undefined; /** * The [timestamp](#workingwithdates) indicating when the shipment failed to be completed. * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ failed_at?: string | undefined; /** * A description of why the shipment failed to be completed. */ failure_reason?: string | undefined; } /** * The current state of this fulfillment. */ export class OrderFulfillmentState {} /** * The type of fulfillment. */ export class OrderFulfillmentType {} export class OrderFulfillmentUpdated { /** * The order's unique ID. */ order_id?: string | undefined; /** * Version number which is incremented each time an update is committed to the order. * Orders that were not created through the API will not include a version and thus cannot be updated. * [Read more about working with versions](https://developer.squareup.com/docs/docs/orders-api/manage-orders#update-orders) */ version?: number | undefined; /** * The ID of the merchant location this order is associated with. */ location_id?: string | undefined; /** * The state of the order. See [OrderState](#type-orderstate) for possible values */ state?: string | undefined; /** * Timestamp for when the order was created in RFC 3339 format. */ created_at?: string | undefined; /** * Timestamp for when the order was last updated in RFC 3339 format. */ updated_at?: string | undefined; /** * The fulfillment that were updated with this version change. */ fulfillment_update?: OrderFulfillmentUpdatedUpdate[] | undefined; } export class OrderFulfillmentUpdatedObject { /** * Information about the updated order fulfillment. */ order_fulfillment_updated?: OrderFulfillmentUpdated | undefined; } /** * Information about fulfillment updates. */ export class OrderFulfillmentUpdatedUpdate { /** * Unique ID that identifies the fulfillment only within this order. */ fulfillment_uid?: string | undefined; /** * The state of the fulfillment before the change. * Will not be populated if the fulfillment is created with this new Order version. * See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values. */ old_state?: string | undefined; /** * The state of the fulfillment after the change. * May be equal to old_state if a non-state field was changed on the fulfillment (e.g. tracking number). * See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values. */ new_state?: string | undefined; } /** * Represents a line item in an order. * Each line item describes a different product to purchase, with its own quantity and price details. */ export class OrderLineItem { /** * Unique ID that identifies the line item only within this order. */ uid?: string | undefined; /** * The name of the line item. */ name?: string | undefined; /** * The quantity purchased, formatted as a decimal number. For example: `\"3\"`. * Line items with a quantity of `\"0\"` will be automatically removed upon paying for or otherwise completing the order. * Line items with a `quantity_unit` can have non-integer quantities. For example: `\"1.70000\"`. */ quantity: string; /** * The unit and precision that this line item's quantity is measured in. */ quantity_unit?: OrderQuantityUnit | undefined; /** * The note of the line item. */ note?: string | undefined; /** * The `CatalogItemVariation` id applied to this line item. */ catalog_object_id?: string | undefined; /** * The name of the variation applied to this line item. */ variation_name?: string | undefined; /** * Application-defined data attached to this line item. Metadata fields are intended to store descriptive references * or associations with an entity in another system or store brief information about the object. Square does not * process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive * information (personally identifiable information, card details, etc.). Keys written by applications must be 60 * characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. * These keys are prefixed with a namespace, separated from the key with a ':' character. Values have a max length of 255 characters. * An application may have up to 10 entries per metadata field. Entries written by applications are private and can only * be read or modified by the same application. * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. */ metadata?: { [key: string]: string } | undefined; /** * The [CatalogModifier](#type-catalogmodifier)s applied to this line item. */ modifiers?: OrderLineItemModifier[] | undefined; /** * The list of references to taxes applied to this line item. Each `OrderLineItemAppliedTax` has a `tax_uid` that * references the `uid` of a top-level `OrderLineItemTax` applied to the line item. On reads, the amount applied is populated. * An `OrderLineItemAppliedTax` will be automatically created on every line item for all `ORDER` scoped taxes * added to the order. `OrderLineItemAppliedTax` records for `LINE_ITEM` scoped taxes must be added in requests for * the tax to apply to any line items. To change the amount of a tax, modify the referenced top-level tax. */ applied_taxes?: OrderLineItemAppliedTax[] | undefined; /** * The list of references to discounts applied to this line item. Each `OrderLineItemAppliedDiscount` has a * `discount_uid` that references the `uid` of a top-level `OrderLineItemDiscounts` applied to the line item. * On reads, the amount applied is populated. An `OrderLineItemAppliedDiscount` will be automatically created on * every line item for all `ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` * records for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any line items. * To change the amount of a discount, modify the referenced top-level discount. */ applied_discounts?: OrderLineItemAppliedDiscount[] | undefined; /** * The base price for a single unit of the line item. */ base_price_money?: Money | undefined; /** * The total price of all item variations sold in this line item. * Calculated as `base_price_money` multiplied by `quantity`. Does not include modifiers. */ variation_total_price_money?: Money | undefined; /** * The amount of money made in gross sales for this line item. * Calculated as the sum of the variation's total price and each modifier's total price. */ gross_sales_money?: Money | undefined; /** * The total tax amount of money to collect for the line item. */ total_tax_money?: Money | undefined; /** * The total discount amount of money to collect for the line item. */ total_discount_money?: Money | undefined; /** * The total amount of money to collect for this line item. */ total_money?: Money | undefined; } /** * Represents an applied portion of a discount to a line item in an order. * Order scoped discounts will automatically have 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 will automatically be computed based on participating line items. */ export class OrderLineItemAppliedDiscount { /** * Unique ID that identifies the applied discount only within this order. */ uid?: string | undefined; /** * The `uid` of the discount the applied discount represents. Must reference a discount present in the * `order.discounts` field. This field is immutable. To change which discounts apply to a line item, you must delete * the discount and re-add it as a new `OrderLineItemAppliedDiscount`. */ discount_uid: string; /** * The amount of money applied by the discount to the line item. */ applied_money?: Money | undefined; } /** * 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 class OrderLineItemAppliedTax { /** * Unique ID that identifies the applied tax only within this order. */ uid?: string | undefined; /** * The `uid` of the tax for which this applied tax represents. * Must reference a tax present in the `order.taxes` field. This field is immutable. * To change which taxes apply to a line item, delete and add new `OrderLineItemAppliedTax`s. */ tax_uid: string; /** * The amount of money applied by the tax to the line item. */ applied_money?: Money | undefined; } /** * 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 class OrderLineItemDiscount { /** * Unique ID that identifies the discount only within this order. */ uid?: string | undefined; /** * The catalog object id referencing `CatalogDiscount`. */ catalog_object_id?: string | undefined; /** * The discount's name. */ name?: string | undefined; /** * The type of the discount. Discounts that don't reference a catalog object ID must have a type of `FIXED_PERCENTAGE` * or `FIXED_AMOUNT`. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. */ type?: DiscountType | undefined; /** * The percentage of the discount, as a string representation of a decimal number. * A value of `7.25` corresponds to a percentage of 7.25%. `percentage` is not set for amount-based discounts. */ percentage?: string | undefined; /** * The total declared monetary amount of the discount. `amount_money` is not set for percentage-based discounts. */ amount_money?: Money | undefined; /** * The amount of discount actually applied to the line item. Represents the amount of money applied as a line * item-scoped discount. When an amount-based discount is scoped to the entire order, the value of `applied_money` * is different from `amount_money` because the total amount of the discount is distributed across all line items. */ applied_money?: Money | undefined; /** * Application-defined data attached to this discount. Metadata fields are intended to store descriptive references * or associations with an entity in another system or store brief information about the object. Square does not process * this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information * (personally identifiable information, card details, etc.). Keys written by applications must be 60 characters or * less and must be in the character set `[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. * These keys are prefixed with a namespace, separated from the key with a ':' character. Values have a max length * of 255 characters. An application may have up to 10 entries per metadata field. Entries written by applications * are private and can only be read or modified by the same application. * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. */ metadata?: Record | undefined; /** * Indicates the level at which the discount applies. For `ORDER` scoped discounts, Square generates references * in `applied_discounts` on all order line items that do not have them. For `LINE_ITEM` scoped discounts, * the discount only applies to line items with a discount reference in their `applied_discounts` field. * This field is immutable. To change the scope of a discount you must delete the discount and re-add it as a new discount. * See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values. */ scope?: DiscountApplicationScopeType | undefined; /** * The reward identifiers corresponding to this discount. * The application and specification of discounts that have `reward_ids` are completely controlled by the backing * criteria corresponding to the reward tiers of the rewards that are added to the order through the Loyalty API. * To manually unapply discounts that are the result of added rewards, the rewards must be removed from the order through the Loyalty API. */ reward_ids?: string[] | undefined; /** * The object identifier of a `pricing rule` to be applied automatically to this discount. * The specification and application of the discounts, to which a `pricing_rule_id` is assigned, * are completely controlled by the corresponding pricing rule. */ pricing_rule_id?: string | undefined; } /** * Indicates whether this is a line item or order level discount. */ export class OrderLineItemDiscountScope {} /** * Indicates how the discount is applied to the associated line item or order. */ export class OrderLineItemDiscountType {} /** * A [CatalogModifier](#type-catalogmodifier). */ export class OrderLineItemModifier { /** * Unique ID that identifies the modifier only within this order. */ uid?: string | undefined; /** * The catalog object id referencing `CatalogModifier`. */ catalog_object_id?: string | undefined; /** * The name of the item modifier. */ name?: string | undefined; /** * The base price for the modifier. `base_price_money` is required for ad hoc modifiers. * If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the predefined `CatalogModifier` price. */ base_price_money?: Money | undefined; /** * The total price of the item modifier for its line item. * This is the modifier's `base_price_money` multiplied by the line item's quantity. */ total_price_money?: Money | undefined; } /** * 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 class OrderLineItemTax { /** * Unique ID that identifies the tax only within this order. */ uid?: string | undefined; /** * The catalog object id referencing `CatalogTax`. */ catalog_object_id?: string | undefined; /** * The tax's name. */ name?: string | undefined; /** * Indicates the calculation method used to apply the tax. * See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. */ type?: TaxType | undefined; /** * The percentage of the tax, as a string representation of a decimal number. * For example, a value of "7.25" corresponds to a percentage of 7.25%. */ percentage?: string | undefined; /** * Application-defined data attached to this tax. Metadata fields are intended to store descriptive references or * associations with an entity in another system or store brief information about the object. Square does not process * this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information * (personally identifiable information, card details, etc.). Keys written by applications must be 60 characters * or less and must be in the character set `[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. * These keys are prefixed with a namespace, separated from the key with a ':' character. Values have a max length * of 255 characters. An application may have up to 10 entries per metadata field. Entries written by applications * are private and can only be read or modified by the same application. * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. */ metadata?: Record | undefined; /** * The amount of the money applied by the tax in the order. */ applied_money?: Money | undefined; /** * Indicates the level at which the tax applies. For `ORDER` scoped taxes, Square generates references in * `applied_taxes` on all order line items that do not have them. For `LINE_ITEM` scoped taxes, the tax will only * apply to line items with references in their `applied_taxes` field. This field is immutable. * To change the scope, you must delete the tax and re-add it as a new tax. * See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values. */ scope?: TaxApplicationScopeType | undefined; } /** * Indicates whether this is a line item or order level tax. */ export class OrderLineItemTaxScope {} /** * Indicates how the tax is applied to the associated line item or order. */ export class OrderLineItemTaxType {} /** * A collection of various money amounts. */ export class OrderMoneyAmounts { /** * Total money. */ total_money?: Money | undefined; /** * Money associated with taxes. */ tax_money?: Money | undefined; /** * Money associated with discounts. */ discount_money?: Money | undefined; /** * Money associated with tips. */ tip_money?: Money | undefined; /** * Money associated with service charges. */ service_charge_money?: Money | undefined; } /** * 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 * pre-configured [pricing rules](/reference/square/objects/CatalogPricingRule). */ export class OrderPricingOptions { /** * The option to determine whether or not pricing rule-based discounts are automatically applied to an order. */ auto_apply_discounts?: boolean | undefined; } /** * Contains the measurement unit for a quantity and a precision which specifies the number of digits after the decimal * point for decimal quantities. */ export class OrderQuantityUnit { /** * A `MeasurementUnit` that represents the unit of measure for the quantity. */ measurement_unit?: MeasurementUnit | undefined; /** * For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity. * For example, a precision of 1 allows quantities like "1.0" and "1.1", but not "1.01". Min: 0. Max: 5. */ precision?: number | undefined; } /** * The set of line items, service charges, taxes, discounts, tips, etc. being returned in an Order. */ export class OrderReturn { /** * Unique ID that identifies the return only within this order. */ uid?: string | undefined; /** * Order which contains the original sale of these returned line items. This will be unset for unlinked returns. */ source_order_id?: string | undefined; /** * Collection of line items which are being returned. */ return_line_items?: OrderReturnLineItem[] | undefined; /** * Collection of service charges which are being returned. */ return_service_charges?: OrderReturnServiceCharge[] | undefined; /** * Collection of references to taxes being returned for an order, including the total applied tax amount to be returned. * The taxes must reference a top-level tax ID from the source order. */ return_taxes?: OrderReturnTax[] | undefined; /** * Collection of references to discounts being returned for an order, including the total applied discount amount to be returned. * The discounts must reference a top-level discount ID from the source order. */ return_discounts?: OrderReturnDiscount[] | undefined; /** * A positive or negative rounding adjustment to the total value being returned. Commonly used to apply Cash Rounding * when the minimum unit of account is smaller than the lowest physical denomination of currency. */ rounding_adjustment?: OrderRoundingAdjustment | undefined; /** * Aggregate monetary value being returned by this Return entry. */ return_amounts?: OrderMoneyAmounts | undefined; } /** * 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 class OrderReturnDiscount { /** * Unique ID that identifies the return discount only within this order. */ uid?: string | undefined; /** * `uid` of the Discount from the Order which contains the original application of this discount. */ source_discount_uid?: string | undefined; /** * The catalog object id referencing `CatalogDiscount`. */ catalog_object_id?: string | undefined; /** * The discount's name. */ name?: string | undefined; /** * The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. * Discounts that don't reference a catalog object ID must have a type of `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. * See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. */ type?: DiscountType | undefined; /** * The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds * to a percentage of 7.25%. `percentage` is not set for amount-based discounts. */ percentage?: string | undefined; /** * The total declared monetary amount of the discount. `amount_money` is not set for percentage-based discounts. */ amount_money?: Money | undefined; /** * The amount of discount actually applied to this line item. When an amount-based discount is at order-level, * this value is different from `amount_money` because the discount is distributed across the line items. */ applied_money?: Money | undefined; /** * Indicates the level at which the discount applies. This field is set by the server. * If set in a CreateOrder request, it will be ignored on write. * See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values. */ scope?: DiscountApplicationScopeType | undefined; } /** * The line item being returned in an Order. */ export class OrderReturnLineItem { /** * Unique identifier for this return line item entry. */ uid?: string | undefined; /** * `uid` of the LineItem in the original sale Order. */ source_line_item_uid?: string | undefined; /** * The name of the line item. */ name?: string | undefined; /** * The quantity returned, formatted as a decimal number. For example: "3". * Line items with a `quantity_unit` can have non-integer quantities. For example: "1.70000". */ quantity: string; /** * The unit and precision that this return line item's quantity is measured in. */ quantity_unit?: OrderQuantityUnit | undefined; /** * The note of the returned line item. */ note?: string | undefined; /** * The `CatalogItemVariation` id applied to this returned line item. */ catalog_object_id?: string | undefined; /** * The name of the variation applied to this returned line item. */ variation_name?: string | undefined; /** * The `CatalogModifier`s applied to this line item. */ return_modifiers?: OrderReturnLineItemModifier[] | undefined; /** * The list of references to `OrderReturnTax` entities applied to the returned line item. * Each `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level `OrderReturnTax` * applied to the returned line item. On reads, the amount applied is populated. */ applied_taxes?: OrderLineItemAppliedTax[] | undefined; /** * The list of references to `OrderReturnDiscount` entities applied to the returned line item. * Each `OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level `OrderReturnDiscount` * applied to the returned line item. On reads, the amount applied is populated. */ applied_discounts?: OrderLineItemAppliedDiscount[] | undefined; /** * The base price for a single unit of the line item. */ base_price_money?: Money | undefined; /** * The total price of all item variations returned in this line item. * Calculated as `base_price_money` multiplied by `quantity`. Does not include modifiers. */ variation_total_price_money?: Money | undefined; /** * The gross return amount of money calculated as (item base price + modifiers price) * quantity. */ gross_return_money?: Money | undefined; /** * The total tax amount of money to return for the line item. */ total_tax_money?: Money | undefined; /** * The total discount amount of money to return for the line item. */ total_discount_money?: Money | undefined; /** * The total amount of money to return for this line item. */ total_money?: Money | undefined; } /** * A line item modifier being returned. */ export class OrderReturnLineItemModifier { /** * Unique ID that identifies the return modifier only within this order. */ uid?: string | undefined; /** * `uid` of the Modifier from the LineItem from the Order which contains the original sale of this line item modifier. */ source_modifier_uid?: string | undefined; /** * The catalog object id referencing `CatalogModifier`. */ catalog_object_id?: string | undefined; /** * The name of the item modifier. */ name?: string | undefined; /** * The base price for the modifier. `base_price_money` is required for ad hoc modifiers. * If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the predefined `CatalogModifier` price. */ base_price_money?: Money | undefined; /** * The total price of the item modifier for its line item. * This is the modifier's `base_price_money` multiplied by the line item's quantity. */ total_price_money?: Money | undefined; } /** * Represents the service charge applied to the original order. */ export class OrderReturnServiceCharge { /** * Unique ID that identifies the return service charge only within this order. */ uid?: string | undefined; /** * `uid` of the Service Charge from the Order containing the original charge of the service charge. * `source_service_charge_uid` is `null` for unlinked returns. */ source_service_charge_uid?: string | undefined; /** * The name of the service charge. */ name?: string | undefined; /** * The catalog object ID of the associated `CatalogServiceCharge`. */ catalog_object_id?: string | undefined; /** * The percentage of the service charge, as a string representation of a decimal number. * For example, a value of "7.25" corresponds to a percentage of 7.25%. * Exactly one of `percentage` or `amount_money` should be set. */ percentage?: string | undefined; /** * The amount of a non-percentage based service charge. Exactly one of `percentage` or `amount_money` should be set. */ amount_money?: Money | undefined; /** * The amount of money applied to the order by the service charge, including any inclusive tax amounts, as calculated by Square. * - For fixed-amount service charges, `applied_money` is equal to `amount_money`. * - For percentage-based service charges, `applied_money` is the money calculated using the percentage. */ applied_money?: Money | undefined; /** * The total amount of money to collect for the service charge. * @note if an inclusive tax is applied to the service charge, `total_money` does not equal `applied_money` * plus `total_tax_money` since the inclusive tax amount will already be included in both `applied_money` * and `total_tax_money`. */ total_money?: Money | undefined; /** * The total amount of tax money to collect for the service charge. */ total_tax_money?: Money | undefined; /** * The calculation phase after which to apply the service charge. * See [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) for possible values. */ calculation_phase?: string | undefined; /** * Indicates whether the surcharge can be taxed. Service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable. */ taxable?: boolean | undefined; /** * The list of references to `OrderReturnTax` entities applied to the `OrderReturnServiceCharge`. * Each `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level `OrderReturnTax` that * is being applied to the `OrderReturnServiceCharge`. On reads, the amount applied is populated. */ applied_taxes?: OrderLineItemAppliedTax[] | undefined; } /** * 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 class OrderReturnTax { /** * Unique ID that identifies the return tax only within this order. */ uid?: string | undefined; /** * `uid` of the Tax from the Order which contains the original charge of this tax. */ source_tax_uid?: string | undefined; /** * The catalog object id referencing `CatalogTax`. */ catalog_object_id?: string | undefined; /** * The tax's name. */ name?: string | undefined; /** * Indicates the calculation method used to apply the tax. * See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. */ type?: TaxType | undefined; /** * The percentage of the tax, as a string representation of a decimal number. * For example, a value of "7.25" corresponds to a percentage of 7.25%. */ percentage?: string | undefined; /** * The amount of the money applied by the tax in an order. */ applied_money?: Money | undefined; /** * Indicates the level at which the `OrderReturnTax` applies. For `ORDER` scoped taxes, Square generates references * in `applied_taxes` on all `OrderReturnLineItem`s. For `LINE_ITEM` scoped taxes, the tax will only apply to * `OrderReturnLineItem`s with references in their `applied_discounts` field. * See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values. */ scope?: TaxApplicationScopeType | undefined; } /** * Represents a reward that may be applied to an order if the necessary reward tier criteria are met. * Rewards are created through the Loyalty API. */ export class OrderReward { /** * The identifier of the reward. */ id: string; /** * The identifier of the reward tier corresponding to this reward. */ reward_tier_id: string; } /** * A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding when the minimum unit * of account is smaller than the lowest physical denomination of currency. */ export class OrderRoundingAdjustment { /** * Unique ID that identifies the rounding adjustment only within this order. */ uid?: string | undefined; /** * The name of the rounding adjustment from the original sale Order. */ name?: string | undefined; /** * Actual rounding adjustment amount. */ amount_money?: Money | undefined; } /** * Represents a service charge applied to an order. */ export class OrderServiceCharge { /** * Unique ID that identifies the service charge only within this order. */ uid?: string | undefined; /** * The name of the service charge. */ name?: string | undefined; /** * The catalog object ID referencing the service charge `CatalogObject`. */ catalog_object_id?: string | undefined; /** * The service charge percentage as a string representation of a decimal number. * For example, "7.25" indicates a service charge of 7.25%. Exactly 1 of `percentage` or `amount_money` should be set. */ percentage?: string | undefined; /** * The amount of a non-percentage based service charge. Exactly one of `percentage` or `amount_money` should be set. */ amount_money?: Money | undefined; /** * The amount of money applied to the order by the service charge, including any inclusive tax amounts, as calculated by Square. * - For fixed-amount service charges, `applied_money` is equal to `amount_money`. * - For percentage-based service charges, `applied_money` is the money calculated using the percentage. */ applied_money?: Money | undefined; /** * The total amount of money to collect for the service charge. * @note if an inclusive tax is applied to the service charge, `total_money` __does not__ equal `applied_money` plus * `total_tax_money` since the inclusive tax amount will already be included in both `applied_money` and `total_tax_money`. */ total_money?: Money | undefined; /** * The total amount of tax money to collect for the service charge. */ total_tax_money?: Money | undefined; /** * The calculation phase at which to apply the service charge. * See [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) for possible values. */ calculation_phase?: string | undefined; /** * Indicates whether the service charge can be taxed. If set to `true`, order-level taxes automatically apply to * the service charge. Note that service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable. */ taxable?: boolean | undefined; /** * The list of references to taxes applied to this service charge. * Each `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level `OrderLineItemTax` that * is being applied to this service charge. On reads, the amount applied is populated. An `OrderLineItemAppliedTax` * will be automatically created on every taxable service charge for all `ORDER` scoped taxes that are added to the order. * `OrderLineItemAppliedTax` records for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to * any taxable service charge. Taxable service charges have the `taxable` field set to true and calculated in * the `SUBTOTAL_PHASE`. To change the amount of a tax, modify the referenced top-level tax. */ applied_taxes?: OrderLineItemAppliedTax[] | undefined; /** * Application-defined data attached to this service charge. Metadata fields are intended to store descriptive * references or associations with an entity in another system or store brief information about the object. Square * does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store * any sensitive information (personally identifiable information, card details, etc.). Keys written by applications * must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries may also include metadata * generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character. * Values have a max length of 255 characters. An application may have up to 10 entries per metadata field. * Entries written by applications are private and can only be read or modified by the same application. * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. */ metadata?: Record | undefined; } /** * 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/docs/orders-api/how-it-works#how-totals-are-calculated). */ export class OrderServiceChargeCalculationPhase {} /** * Represents the origination details of an order. */ export class OrderSource { /** * The name used to identify the place (physical or digital) that an order originates. * If unset, the name defaults to the name of the application that created the order. */ name?: string | undefined; } /** * The state of the order. */ export class OrderState {} export class OrderUpdated { /** * The order's unique ID. */ order_id?: string | undefined; /** * Version number which is incremented each time an update is committed to the order. * Orders that were not created through the API will not include a version and thus cannot be updated. * [Read more about working with versions](https://developer.squareup.com/docs/docs/orders-api/manage-orders#update-orders). */ version?: number | undefined; /** * The ID of the merchant location this order is associated with. */ location_id?: string | undefined; /** * The state of the order. See [OrderState](#type-orderstate) for possible values */ state?: string | undefined; /** * Timestamp for when the order was created in RFC 3339 format. */ created_at?: string | undefined; /** * Timestamp for when the order was last updated in RFC 3339 format. */ updated_at?: string | undefined; } export class OrderUpdatedObject { /** * Information about the updated order. */ order_updated?: OrderUpdated | undefined; } /** * Defines the fields that are included in requests to the [PayOrder](#endpoint-payorder) endpoint. */ export class PayOrderRequest { /** * A value you specify that uniquely identifies this request among requests you've sent. * If you're unsure whether a particular payment request was completed successfully, you can reattempt it with the * same idempotency key without worrying about duplicate payments. * See [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency) for more information. */ idempotency_key: string; /** * The version of the order being paid. If not supplied, the latest version will be paid. */ order_version?: number | undefined; /** * The IDs of the `payments` to collect. The payment total must match the order total. */ payment_ids?: string[] | undefined; } /** * Defines the fields that are included in the response body of a request to the [PayOrder](#endpoint-payorder) endpoint. */ export class PayOrderResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The paid, updated `order`. */ order?: Order | undefined; } /** * Represents a payment processed by the Square API. */ export class Payment { /** * Unique ID for the payment. */ id?: string | undefined; /** * Timestamp of when the payment was created, in RFC 3339 format. */ created_at?: string | undefined; /** * Timestamp of when the payment was last updated, in RFC 3339 format. */ updated_at?: string | undefined; /** * The amount of money processed for this payment, not including `tip_money`. Specified in the smallest denomination * of the applicable currency. For example, US dollar amounts are specified in cents. For more information, * see [Working with monetary amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). */ amount_money?: Money | undefined; /** * The amount designated as a tip. Specified in the smallest denomination of the applicable currency. * For example, US dollar amounts are specified in cents. */ tip_money?: Money | undefined; /** * The total money for the payment, including `amount_money` and `tip_money`. * Specified in the smallest denomination of the applicable currency. For example, US dollar amounts are specified in cents. */ total_money?: Money | undefined; /** * The amount of money the developer is taking as a fee for facilitating the payment on behalf of the seller. * Specified in the smallest denomination of the applicable currency. For example, US dollar amounts are specified in cents. * For more information, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). * Cannot be more than 90% of the `total_money` value. */ app_fee_money?: Money | undefined; /** * Processing fees and fee adjustments assessed by Square on this payment. */ processing_fee?: ProcessingFee[] | undefined; /** * Total amount of the payment refunded to-date. Specified in the smallest denomination of the applicable currency. * For example, US dollar amounts are specified in cents. */ refunded_money?: Money | undefined; /** * Indicates whether the payment is `APPROVED`, `COMPLETED`, `CANCELED`, or `FAILED`. */ status?: string | undefined; /** * The duration of time after the payment's creation when Square automatically applies the `delay_action` to the payment. * This automatic `delay_action` applies only to payments that don't reach a terminal state (COMPLETED, CANCELED, or FAILED) * before the `delay_duration` time period. This field is specified as a time duration, in RFC 3339 format. * Notes: This feature is only supported for card payments. * Default: * - Card Present payments: "PT36H" (36 hours) from the creation time. * - Card Not Present payments: "P7D" (7 days) from the creation time. */ delay_duration?: string | undefined; /** * The action to be applied to the payment when the `delay_duration` has elapsed. This field is read only. * Current values include: `CANCEL`. */ delay_action?: string | undefined; /** * Read only timestamp of when the `delay_action` will automatically be applied, in RFC 3339 format. * Note that this field is calculated by summing the payment's `delay_duration` and `created_at` fields. * The `created_at` field is generated by Square and may not exactly match the time on your local machine. */ delayed_until?: string | undefined; /** * The source type for this payment. Current values include: `CARD`. */ source_type?: string | undefined; /** * Non-confidential details about the source. Only populated if the `source_type` is `CARD`. */ card_details?: CardPaymentDetails | undefined; /** * ID of the location associated with the payment. */ location_id?: string | undefined; /** * ID of the order associated with this payment. */ order_id?: string | undefined; /** * An optional ID that associates this payment with an entity in another system. */ reference_id?: string | undefined; /** * The `Customer` ID of the customer associated with the payment. */ customer_id?: string | undefined; /** * An optional ID of the employee associated with taking this payment. */ employee_id?: string | undefined; /** * List of `refund_id`s identifying refunds for this payment. */ refund_ids?: string[] | undefined; /** * The buyer's e-mail address. */ buyer_email_address?: string | undefined; /** * The buyer's billing address. */ billing_address?: Address | undefined; /** * The buyer's shipping address. */ shipping_address?: Address | undefined; /** * An optional note to include when creating a payment. */ note?: string | undefined; /** * Additional payment information that gets added on the customer's card statement as part of the statement description. * Note that the `statement_description_identifier` may get truncated on the statement description to fit the required * information including the Square identifier (SQ *) and name of the merchant taking the payment. */ statement_description_identifier?: string | undefined; /** * The payment's receipt number. The field will be missing if a payment is CANCELED. */ receipt_number?: string | undefined; /** * The URL for the payment's receipt. The field will only be populated for COMPLETED payments. */ receipt_url?: string | undefined; } export class PaymentOptions { /** * Indicates whether the Payment objects created from this `TerminalCheckout` will automatically be `COMPLETED` * or left in an `APPROVED` state for later modification. */ autocomplete?: boolean | undefined; } /** * Represents a refund of a payment made using Square. Contains information on the original payment and the amount of money refunded. */ export class PaymentRefund { /** * Unique ID for this refund, generated by Square. */ id: string; /** * The refund's status: * - `PENDING` - awaiting approval * - `COMPLETED` - successfully completed * - `REJECTED` - the refund was rejected * - `FAILED` - an error occurred */ status: "PENDING" | "COMPLETED" | "REJECTED" | "FAILED"; /** * Location ID associated with the payment this refund is attached to. */ location_id?: string | undefined; /** * The amount of money refunded, specified in the smallest denomination of the applicable currency. * For example, US dollar amounts are specified in cents. */ amount_money: Money; /** * Amount of money the app developer contributed to help cover the refunded amount. Specified in the smallest * denomination of the applicable currency. For example, US dollar amounts are specified in cents. * See [Working with monetary amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) for details. */ app_fee_money?: Money | undefined; /** * Processing fees and fee adjustments assessed by Square on this refund. */ processing_fee?: ProcessingFee[] | undefined; /** * The ID of the payment assocated with this refund. */ payment_id?: string | undefined; /** * The ID of the order associated with the refund. */ order_id?: string | undefined; /** * The reason for the refund. */ reason?: string | undefined; /** * Timestamp of when the refund was created, in RFC 3339 format. */ created_at?: string | undefined; /** * Timestamp of when the refund was last updated, in RFC 3339 format. */ updated_at?: string | undefined; } /** * Represents Square processing fee. */ export class ProcessingFee { /** * Timestamp of when the fee takes effect, in RFC 3339 format. */ effective_at?: string | undefined; /** * The type of fee assessed or adjusted. Can be one of: `INITIAL`, `ADJUSTMENT`. */ type?: string | undefined; /** * The fee amount assessed or adjusted by Square. May be negative. * Positive values represent funds being assessed, while negative values represent funds being returned. */ amount_money?: Money | undefined; } /** * Indicates the Square product used to generate an inventory change. */ export class Product {} export class ProductType {} /** * Describes a `PublishInvoice` request. */ export class PublishInvoiceRequest { /** * The version of the `Invoice` to publish. This must match the current version of the invoice, otherwise the request is rejected. */ version: number; /** * A unique string that identifies the `PublishInvoice` request. * If you do not provide `idempotency_key` (or provide an empty string as the value), the endpoint treats each request as independent. * For more information, see [Idempotency](https://developer.squareup.com/docs/docs/working-with-apis/idempotency). */ idempotency_key?: string | undefined; } /** * Describes a `PublishInvoice` response. */ export class PublishInvoiceResponse { /** * The published invoice. */ invoice?: Invoice | undefined; /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; } /** * The range of a number value between the specified lower and upper bounds. */ export class Range { /** * The lower bound of the number range. */ min?: string | undefined; /** * The upper bound of the number range. */ max?: string | undefined; } /** * A request to redeem a loyalty reward. */ export class RedeemLoyaltyRewardRequest { /** * A unique string that identifies this `RedeemLoyaltyReward` request. Keys can be any valid string, but must be unique for every request. */ idempotency_key: string; /** * The ID of the `location` where the reward is redeemed. */ location_id: string; } /** * A response that includes the `LoyaltyEvent` published for redeeming the reward. */ export class RedeemLoyaltyRewardResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The `LoyaltyEvent` for redeeming the reward. */ event?: LoyaltyEvent | undefined; } /** * Represents a refund processed for a Square transaction. */ export class Refund { /** * The refund's unique ID. */ id: string; /** * The ID of the refund's associated location. */ location_id: string; /** * The ID of the transaction that the refunded tender is part of. */ transaction_id: string; /** * The ID of the refunded tender. */ tender_id: string; /** * The timestamp for when the refund was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The reason for the refund being issued. */ reason: string; /** * The amount of money refunded to the buyer. */ amount_money: Money; /** * The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, or `FAILED`). * See [RefundStatus](#type-refundstatus) for possible values. */ status: "PENDING" | "APPROVED" | "REJECTED" | "FAILED"; /** * The amount of Square processing fee money refunded to the *merchant*. */ processing_fee_money?: Money | undefined; /** * Additional recipients (other than the merchant) receiving a portion of this refund. * For example, fees assessed on a refund of a purchase by a third party integration. */ additional_recipients?: AdditionalRecipient[] | undefined; } /** * Refunds a payment. */ export class RefundPaymentRequest { /** * A unique string that identifies this RefundPayment request. * Key can be any valid string but must be unique for every RefundPayment request. * For more information, see [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency). */ idempotency_key: string; /** * The amount of money to refund. Cannot be more than the `total_money` value of the payment minus the total amount * of all previously completed refunds for this payment. Must be specified in the smallest denomination of the applicable currency. * For example, US dollar amounts are specified in cents. * See [Working with monetary amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) for details. * The currency code must match the currency associated with the business that is charging the card. */ amount_money: Money; /** * Amount of money the developer will contribute to help cover the refunded amount. Specified in the smallest * denomination of the applicable currency. For example, US dollar amounts are specified in cents. Value cannot be * more than the `amount_money`. You can specify this parameter in a refund request only if the same parameter was * also included when taking the payment. This is part of the application fee scenario the API supports. * For more information, see [Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). */ app_fee_money?: Money | undefined; /** * Unique ID of the payment being refunded. */ payment_id: string; /** * A description of the reason for the refund. */ reason?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the [RefundPayment](#endpoint-refunds-refundpayment) endpoint. * Note: if there are errors processing the request, the refund field may not be present, or it may be present in a FAILED state. */ export class RefundPaymentResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The successfully created `PaymentRefund`. */ refund?: PaymentRefund | undefined; } /** * Indicates a refund's current status. */ export class RefundStatus {} /** * Defines the parameters that can be included in the body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. */ export class RegisterDomainRequest { /** * A domain name as described in RFC-1034 that will be registered with ApplePay */ domain_name: string; } /** * Defines the fields that are included in the response body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. * Either `errors` or `status` will be present in a given response (never both). */ export class RegisterDomainResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * Status of the domain registration. See `RegisterDomainResponseStatus` for possible values. */ status?: "PENDING" | "VERIFIED" | undefined; } /** * The status of domain registration. */ export class RegisterDomainResponseStatus {} /** * Defines parameters for a RemoveDisputeEvidence request. */ export class RemoveDisputeEvidenceRequest {} /** * Defines fields in a RemoveDisputeEvidence response. */ export class RemoveDisputeEvidenceResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; } /** * Defines the fields that are included in the request body of a request to the [RemoveGroupFromCustomer](#endpoint-removegroupfromcustomer) endpoint. */ export class RemoveGroupFromCustomerRequest {} /** * Defines the fields that are included in the response body of a request to the [RemoveGroupFromCustomer](#endpoint-removegroupfromcustomer) endpoint. */ export class RemoveGroupFromCustomerResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class RenewTokenRequest { /** * The token you want to renew. */ access_token?: string | undefined; } export class RenewTokenResponse { /** * The renewed access token. This value might be different from the `access_token` you provided in your request. * You provide this token in a header with every request to Connect API endpoints. * See [Request and response headers](https://developer.squareup.com/docs/api/connect/v2/#requestandresponseheaders) for the format of this header. */ access_token?: string | undefined; /** * This value is always _bearer_. */ token_type?: string | undefined; /** * The date when access_token expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. */ expires_at?: string | undefined; /** * The ID of the authorizing merchant's business. */ merchant_id?: string | undefined; /** * @deprecated * The ID of the merchant subscription associated with the authorization. Only present if the merchant signed up for * a subscription during authorization. */ subscription_id?: string | undefined; /** * @deprecated * The ID of the subscription plan the merchant signed up for. Only present if the merchant signed up for a * subscription during authorization. */ plan_id?: string | undefined; } export class RetrieveCashDrawerShiftRequest { /** * The ID of the location to retrieve cash drawer shifts from. */ location_id: string; } export class RetrieveCashDrawerShiftResponse { /** * The cash drawer shift queried for. */ cash_drawer_shift?: CashDrawerShift | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class RetrieveCatalogObjectRequest { /** * If `true`, the response will include additional objects that are related to the requested object, as follows: * - If the `object` field of the response contains a `CatalogItem`, its associated `CatalogCategory`, `CatalogTax`, * `CatalogImage` and `CatalogModifierList` objects will be returned in the `related_objects` field of the response. * - If the `object` field of the response contains a `CatalogItemVariation`, its parent `CatalogItem` will be returned * in the `related_objects` field of the response. Default value: `false` */ include_related_objects?: boolean | undefined; } export class RetrieveCatalogObjectResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The `CatalogObject`s returned. */ object?: CatalogObject | undefined; /** * A list of `CatalogObject`s referenced by the object in the `object` field. */ related_objects?: CatalogObject[] | undefined; } /** * Defines the fields that can be provided in a request to the [RetrieveCustomerGroup](#endpoint-retrievecustomergroup) endpoint. */ export class RetrieveCustomerGroupRequest {} /** * Defines the fields that are included in the response body of a request to the [RetrieveCustomerGroup](#endpoint-retrievecustomergroup) endpoint. * One of `errors` or `group` is present in a given response (never both). */ export class RetrieveCustomerGroupResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The retrieved customer group. */ group?: CustomerGroup | undefined; } /** * Defines the fields that are included in requests to the RetrieveCustomer endpoint. */ export class RetrieveCustomerRequest {} /** * Defines the fields that are included in the response body of a request to the RetrieveCustomer endpoint. * One of `errors` or `customer` is present in a given response (never both). */ export class RetrieveCustomerResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The requested customer. */ customer?: Customer | undefined; } /** * Defines the valid parameters for requests to __RetrieveCustomerSegmentRequest__. */ export class RetrieveCustomerSegmentRequest {} /** * Defines the fields included in the response body for requests to __RetrieveCustomerSegment__. * One of `errors` or `segment` is present in a given response (never both). */ export class RetrieveCustomerSegmentResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The retrieved customer segment. */ segment?: CustomerSegment | undefined; } /** * Defines parameters for a RetrieveDisputeEvidence request. */ export class RetrieveDisputeEvidenceRequest {} /** * Defines fields in a RetrieveDisputeEvidence response. */ export class RetrieveDisputeEvidenceResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * Metadata about the dispute evidence file. */ evidence?: DisputeEvidence | undefined; } /** * Defines request parameters for the RetrieveDispute endpoint. */ export class RetrieveDisputeRequest {} /** * Defines fields in a RetrieveDispute response. */ export class RetrieveDisputeResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * Details about the requested `Dispute`. */ dispute?: Dispute | undefined; } /** * Retrieve an employee by `Employee.id` */ export class RetrieveEmployeeRequest {} /** * Defines the fields that are included in the response body of a request to the RetrieveEmployee endpoint. * One of `errors` or `employee` is present in a given response (never both). */ export class RetrieveEmployeeResponse { /** * The response object. */ employee?: Employee | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class RetrieveInventoryAdjustmentRequest {} export class RetrieveInventoryAdjustmentResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The requested `InventoryAdjustment`. */ adjustment?: InventoryAdjustment | undefined; } export class RetrieveInventoryChangesRequest { /** * The `Location` IDs to look up as a comma-separated list. An empty list queries all locations. */ location_ids?: string | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; } export class RetrieveInventoryChangesResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The set of inventory changes for the requested object and locations. */ changes?: InventoryChange[] | undefined; /** * The pagination cursor to be used in a subsequent request. If unset, this is the final response. * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; } export class RetrieveInventoryCountRequest { /** * The `Location` IDs to look up as a comma-separated list. An empty list queries all locations. */ location_ids?: string | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. * See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; } export class RetrieveInventoryCountResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The current calculated inventory counts for the requested object and locations. */ counts?: InventoryCount[] | undefined; /** * The pagination cursor to be used in a subsequent request. If unset, this is the final response. * See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. */ cursor?: string | undefined; } export class RetrieveInventoryPhysicalCountRequest {} export class RetrieveInventoryPhysicalCountResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The requested `InventoryPhysicalCount`. */ count?: InventoryPhysicalCount | undefined; } /** * Defines the fields that are included in the request body for the __RetrieveLocation__ endpoint. */ export class RetrieveLocationRequest {} /** * Defines the fields that the [RetrieveLocation](#endpoint-retrievelocation) endpoint returns in a response. */ export class RetrieveLocationResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested location. */ location?: Location | undefined; } /** * A request to retrieve a loyalty account. */ export class RetrieveLoyaltyAccountRequest {} /** * A response that includes the loyalty account. */ export class RetrieveLoyaltyAccountResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The loyalty account. */ loyalty_account?: LoyaltyAccount | undefined; } /** * A request to retrieve a loyalty reward. */ export class RetrieveLoyaltyRewardRequest {} /** * A response that includes the loyalty reward. */ export class RetrieveLoyaltyRewardResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The loyalty reward retrieved. */ reward?: LoyaltyReward | undefined; } /** * Request object for the [RetrieveMerchant](#endpoint-retrievemerchant) endpoint. */ export class RetrieveMerchantRequest {} /** * The response object returned by the [RetrieveMerchant](#endpoint-retrieveMerchant) endpoint. */ export class RetrieveMerchantResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested `Merchant` object. */ merchant?: Merchant | undefined; } export class RetrieveOrderRequest {} export class RetrieveOrderResponse { /** * The requested order. */ order?: Order | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines parameters in a [RetrieveSubscription](#endpoint-subscriptions-retrievesubscription) endpoint request. */ export class RetrieveSubscriptionRequest {} /** * Defines the fields that are included in the response from the [RetrieveSubscription](#endpoint-subscriptions-retrievesubscription) endpoint. */ export class RetrieveSubscriptionResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The subscription retrieved. */ subscription?: Subscription | undefined; } /** * Represents a retrieve request for a `TeamMember` object. */ export class RetrieveTeamMemberRequest {} /** * Represents a response from a retrieve request, containing a `TeamMember` object or error messages. */ export class RetrieveTeamMemberResponse { /** * The successfully retrieved `TeamMember` object. */ team_member?: TeamMember | undefined; /** * The errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines the request body fields for calls to the RetrieveTransaction endpoint. */ export class RetrieveTransactionRequest {} /** * Defines the fields that are included in the response body of a request to the [RetrieveTransaction](#endpont-retrievetransaction) endpoint. * One of `errors` or `transaction` is present in a given response (never both). */ export class RetrieveTransactionResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The requested transaction. */ transaction?: Transaction | undefined; } /** * Represents a retrieve request for the wage setting of a team member */ export class RetrieveWageSettingRequest {} /** * Represents a response from a retrieve request, containing the specified `WageSetting` object or error messages. */ export class RetrieveWageSettingResponse { /** * The successfully retrieved `WageSetting` object. */ wage_setting?: WageSetting | undefined; /** * The errors that occurred during the request. */ errors?: Error[] | undefined; } export class RevokeTokenRequest { /** * The Square issued ID for your application, available from the [application dashboard](https://connect.squareup.com/apps). */ client_id?: string | undefined; /** * The access token of the merchant whose token you want to revoke. * Do not provide a value for merchant_id if you provide this parameter. */ access_token?: string | undefined; /** * The ID of the merchant whose token you want to revoke. * Do not provide a value for access_token if you provide this parameter. */ merchant_id?: string | undefined; /** * If `true`, terminate the given single access token, but do not terminate the entire authorization. Default: `false` */ revoke_only_access_token?: boolean | undefined; } export class RevokeTokenResponse { /** * If the request is successful, this is true. */ success?: boolean | undefined; } /** * Defines the request body for the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint. */ export class SearchCatalogItemsRequest { /** * The text filter expression to return items or item variations containing specified text in the `name`, `description`, * or `abbreviation` attribute value of an item, or in the `name`, `sku`, or `upc` attribute value of an item variation. */ text_filter?: string | undefined; /** * The category id query expression to return items containing the specified category IDs. */ category_ids?: string[] | undefined; /** * The stock-level query expression to return item variations with the specified stock levels. * See [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible values. */ stock_levels?: string[] | undefined; /** * The enabled-location query expression to return items and item variations having specified enabled locations. */ enabled_location_ids?: string[] | undefined; /** * The pagination token, returned in the previous response, used to fetch the next batch of pending results. */ cursor?: string | undefined; /** * The maximum number of results to return per page. The default value is 100. */ limit?: number | undefined; /** * The order to sort the results by item names. The default sort order is ascending (`ASC`). * See [SortOrder](#type-sortorder) for possible values. */ sort_order?: string | undefined; /** * The product types query expression to return items or item variations having the specified product types. * See [CatalogItemProductType](#type-catalogitemproducttype) for possible values. */ product_types?: string[] | undefined; /** * The customer-attribute filter to return items or item variations matching the specified custom attribute expressions. * A maximum number of 10 custom attribute expressions are supported in a single call to the `SearchCatalogItems` endpoint. */ custom_attribute_filters?: CustomAttributeFilter[] | undefined; } /** * Defines supported stock levels of the item inventory. */ export class SearchCatalogItemsRequestStockLevel {} /** * Defines the response body returned from the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint. */ export class SearchCatalogItemsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * Returned items matching the specified query expressions. */ items?: CatalogObject[] | undefined; /** * Pagination token used in the next request to return more of the search result. */ cursor?: string | undefined; /** * Ids of returned item variations matching the specified query expression. */ matched_variation_ids?: string[] | undefined; } export class SearchCatalogObjectsRequest { /** * The pagination cursor returned in the previous response. Leave unset for an initial request. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; /** * The desired set of object types to appear in the search results. * See [CatalogObjectType](#type-catalogobjecttype) for possible values */ object_types?: ObjectType[] | undefined; /** * If `true`, deleted objects will be included in the results. * Deleted objects will have their `is_deleted` field set to `true`. */ include_deleted_objects?: boolean | undefined; /** * If `true`, the response will include additional objects that are related to the requested object, as follows: * - If a CatalogItem is returned in the object field of the response, its associated CatalogCategory, CatalogTax * objects, CatalogImage objects and CatalogModifierList objects will be included in the `related_objects` field of the response. * - If a CatalogItemVariation is returned in the object field of the response, its parent CatalogItem will be * included in the `related_objects` field of the response. */ include_related_objects?: boolean | undefined; /** * Return objects modified after this [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), * in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a timestamp equal * to `begin_time` will not be included in the response. */ begin_time?: string | undefined; /** * A query to be used to filter or sort the results. If no query is specified, the entire catalog will be returned. */ query?: CatalogQuery | undefined; /** * A limit on the number of results to be returned in a single page. * The limit is advisory - the implementation may return more or fewer results. * If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored. */ limit?: number | undefined; } export class SearchCatalogObjectsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The pagination cursor to be used in a subsequent request. If unset, this is the final response. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; /** * The CatalogObjects returned. */ objects?: CatalogObject[] | undefined; /** * A list of CatalogObjects referenced by the objects in the `objects` field. */ related_objects?: CatalogObject[] | undefined; /** * When the associated product catalog was last updated. * Will match the value for `end_time` or `cursor` if either field is included in the `SearchCatalog` request. */ latest_time?: string | undefined; } /** * Defines the fields included in the request body for the SearchCustomers endpoint. */ export class SearchCustomersRequest { /** * Include the pagination cursor in subsequent calls to this endpoint to retrieve the next set of results associated with the original query. * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. */ cursor?: string | undefined; /** * A limit on the number of results to be returned in a single page. * The limit is advisory - the implementation may return more or fewer results. If the supplied limit is negative, * zero, or is higher than the maximum limit of 100, it will be ignored. */ limit?: number | undefined; /** * Query customers based on the given conditions and sort order. Calling SearchCustomers without an explicit query * parameter will return all customers ordered alphabetically based on `given_name` and `family_name`. */ query?: CustomerQuery | undefined; } /** * Defines the fields that are included in the response body of a request to the SearchCustomers endpoint. * One of `errors` or `customers` is present in a given response (never both). */ export class SearchCustomersResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * An array of `Customer` objects that match a query. */ customers?: Customer[] | undefined; /** * A pagination cursor that can be used during subsequent calls to SearchCustomers to retrieve the next set of results * associated with the original query. Pagination cursors are only present when a request succeeds and additional * results are available. * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. */ cursor?: string | undefined; } /** * Describes a `SearchInvoices` request. */ export class SearchInvoicesRequest { /** * Describes the query criteria for searching invoices. */ query: InvoiceQuery; /** * The maximum number of invoices to return (200 is the maximum `limit`). * If not provided, the server uses a default limit of 100 invoices. */ limit?: number | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this cursor to retrieve the next set of results for your original query. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; } /** * Describes a `SearchInvoices` response. */ export class SearchInvoicesResponse { /** * The list of invoices returned by the search. */ invoices?: Invoice[] | undefined; /** * When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of invoices. * If empty, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; } /** * A request to search for loyalty accounts. */ export class SearchLoyaltyAccountsRequest { /** * The search criteria for the request. */ query?: SearchLoyaltyAccountsRequestLoyaltyAccountQuery | undefined; /** * The maximum number of results to include in the response. */ limit?: number | undefined; /** * A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/basics/api101/pagination). */ cursor?: string | undefined; } /** * The search criteria for the loyalty accounts. */ export class SearchLoyaltyAccountsRequestLoyaltyAccountQuery { /** * The set of mappings to use in the loyalty account search. This cannot be combined with `customer_ids`. Max: 30 mappings. */ mappings?: LoyaltyAccountMapping[] | undefined; /** * The set of customer IDs to use in the loyalty account search. This cannot be combined with `mappings`. Max: 30 customer IDs. */ customer_ids?: string[] | undefined; } /** * A response that includes loyalty accounts that satisfy the search criteria. */ export class SearchLoyaltyAccountsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The loyalty accounts that met the search criteria, in order of creation date. */ loyalty_accounts?: LoyaltyAccount[] | undefined; /** * The pagination cursor to use in a subsequent request. If empty, this is the final response. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/basics/api101/pagination). */ cursor?: string | undefined; } /** * A request to search for loyalty events. */ export class SearchLoyaltyEventsRequest { /** * A set of one or more predefined query filters to apply when searching for loyalty events. * The endpoint performs a logical AND to evaluate multiple filters and performs a logical OR on arrays that specifies multiple field values. */ query?: LoyaltyEventQuery | undefined; /** * The maximum number of results to include in the response. The last page might contain fewer events. The default is 30 events. */ limit?: number | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/basics/api101/pagination). */ cursor?: string | undefined; } /** * A response that contains loyalty events that satisfy the search criteria, in order by the `created_at` date. */ export class SearchLoyaltyEventsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The loyalty events that satisfy the search criteria. */ events?: LoyaltyEvent[] | undefined; /** * The pagination cursor to be used in a subsequent request. If empty, this is the final response. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/basics/api101/pagination). */ cursor?: string | undefined; } /** * A request to search for loyalty rewards. */ export class SearchLoyaltyRewardsRequest { /** * The search criteria for the request. If empty, the endpoint retrieves all loyalty rewards in the loyalty program. */ query?: SearchLoyaltyRewardsRequestLoyaltyRewardQuery | undefined; /** * The maximum number of results to return in the response. */ limit?: number | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/basics/api101/pagination). */ cursor?: string | undefined; } /** * The set of search requirements. */ export class SearchLoyaltyRewardsRequestLoyaltyRewardQuery { /** * The ID of the `loyalty account` to which the loyalty reward belongs. */ loyalty_account_id: string; /** * The status of the loyalty reward. See [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible values. */ status?: string | undefined; } /** * A response that includes the loyalty rewards satisfying the search criteria. */ export class SearchLoyaltyRewardsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The loyalty rewards that satisfy the search criteria. These are returned in descending order by `updated_at`. */ rewards?: LoyaltyReward[] | undefined; /** * The pagination cursor to be used in a subsequent request. If empty, this is the final response. */ cursor?: string | undefined; } /** * Filter based on Order `customer_id` and any Tender `customer_id` associated with the Order. * Does not filter based on the [FulfillmentRecipient](#type-orderfulfillmentrecipient) `customer_id`. */ export class SearchOrdersCustomerFilter { /** * List of customer IDs to filter by. Max: 10 customer IDs. */ customer_ids?: string[] | undefined; } /** * 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. * @note If you use the DateTimeFilter in a SearchOrders query, you must also set the `sort_field` in * [OrdersSort](#type-searchorderordersort) to the same field you filter for. For example, if you set the `CLOSED_AT` * field in DateTimeFilter, you must also set the `sort_field` in SearchOrdersSort to `CLOSED_AT`. * Otherwise, SearchOrders will throw an error. * [Learn more about filtering ordersby time range](/orders-api/manage-orders#important-note-on-filtering-orders-by-time-range). */ export class SearchOrdersDateTimeFilter { /** * Time range for filtering on the `created_at` timestamp. * If you use this value, you must also set the `sort_field` in the OrdersSearchSort object to `CREATED_AT`. */ created_at?: TimeRange | undefined; /** * Time range for filtering on the `updated_at` timestamp. * If you use this value, you must also set the `sort_field` in the OrdersSearchSort object to `UPDATED_AT`. */ updated_at?: TimeRange | undefined; /** * Time range for filtering on the `closed_at` timestamp. * If you use this value, you must also set the `sort_field` in the OrdersSearchSort object to `CLOSED_AT`. */ closed_at?: TimeRange | undefined; } /** * Filtering criteria to use for a SearchOrders request. Multiple filters will be ANDed together. */ export class SearchOrdersFilter { /** * Filter by `OrderState`. */ state_filter?: SearchOrdersStateFilter | undefined; /** * Filter for results within a time range. * @note If you filter for orders by time range, you must set SearchOrdersSort to sort by the same field. * [Learn more about filtering orders by time range](https://developer.squareup.com/docs/orders-api/manage-orders#important-note-on-filtering-orders-by-time-range) */ date_time_filter?: SearchOrdersDateTimeFilter | undefined; /** * Filter by fulfillment type or state. */ fulfillment_filter?: SearchOrdersFulfillmentFilter | undefined; /** * Filter by source of order. */ source_filter?: SearchOrdersSourceFilter | undefined; /** * Filter by customers associated with the order. */ customer_filter?: SearchOrdersCustomerFilter | undefined; } /** * Filter based on [Order Fulfillment](#type-orderfulfillment) information. */ export class SearchOrdersFulfillmentFilter { /** * List of `fulfillment types` to filter for. Will return orders if any of its fulfillments match any of the fulfillment * types listed in this field. See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values. */ fulfillment_types?: FulfillmentType[] | undefined; /** * List of `fulfillment states` to filter for. Will return orders if any of its fulfillments match any of the * fulfillment states listed in this field. See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values. */ fulfillment_states?: FulfillmentStateType[] | undefined; } /** * Contains query criteria for the search. */ export class SearchOrdersQuery { /** * Criteria to filter results by. */ filter?: SearchOrdersFilter | undefined; /** * Criteria to sort results by. */ sort?: SearchOrdersSort | undefined; } /** * The request does not have any required fields. When given no query criteria, SearchOrders will return all results * for all of the merchant’s locations. When fetching additional pages using a `cursor`, the `query` must be equal * to the `query` used to fetch the first page of results. */ export class SearchOrdersRequest { /** * The location IDs for the orders to query. All locations must belong to the same merchant. * Min: 1 location IDs. Max: 10 location IDs. */ location_ids?: string[] | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; /** * Query conditions used to filter or sort the results. Note that when fetching additional pages using a cursor, * the query must be equal to the query used to fetch the first page of results. */ query?: SearchOrdersQuery | undefined; /** * Maximum number of results to be returned in a single page. * It is possible to receive fewer results than the specified limit on a given page. Default: `500`. */ limit?: number | undefined; /** * Boolean that controls the format of the search results. * - If `true`, SearchOrders will return `OrderEntry` objects. * - If `false`, SearchOrders will return complete Order objects. * Default: `false`. */ return_entries?: boolean | undefined; } /** * Only one of `order_entries` or `orders` fields will be set, depending on whether `return_entries` was set * on the [SearchOrdersRequest](#type-searchorderrequest). */ export class SearchOrdersResponse { /** * List of `OrderEntries` that fit the query conditions. Populated only if `return_entries` was set to `true` in the request. */ order_entries?: OrderEntry[] | undefined; /** * List of `Order` objects that match query conditions. Populated only if `return_entries` in the request is set to `false`. */ orders?: Order[] | undefined; /** * The pagination cursor to be used in a subsequent request. If unset, this is the final response. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; /** * `Errors` encountered during the search. */ errors?: Error[] | undefined; } /** * Sorting criteria for a SearchOrders request. Results can only be sorted by a timestamp field. */ export class SearchOrdersSort { /** * The field to sort by. * @note When using a `DateTimeFilter`, `sort_field` must match the timestamp field that the DateTimeFilter uses to filter. * For example, If you set your `sort_field` to `CLOSED_AT` and you use a DateTimeFilter, your DateTimeFilter must filter * for orders by their `CLOSED_AT` date. If this field does not match the timestamp field in `DateTimeFilter`, * SearchOrders will return an error. Default: `CREATED_AT`. * See [SearchOrdersSortField](#type-searchorderssortfield) for possible values. */ sort_field: "CREATED_AT" | "UPDATED_AT" | "CLOSED_AT"; /** * The chronological order in which results are returned. Defaults to `DESC`. * See [SortOrder](#type-sortorder) for possible values. */ sort_order?: SortOrderType | undefined; } /** * Specifies which timestamp to use to sort SearchOrder results. */ export class SearchOrdersSortField {} /** * Filter based on order `source` information. */ export class SearchOrdersSourceFilter { /** * Filters by `Source` `name`. Will return any orders with with a `source.name` that matches any of the listed source names. * Max: 10 source names. */ source_names?: string[] | undefined; } /** * Filter by current Order `state`. */ export class SearchOrdersStateFilter { /** * States to filter for. See [OrderState](#type-orderstate) for possible values. */ states: OrderStateType[]; } /** * A request for a filtered and sorted set of `Shift` objects. */ export class SearchShiftsRequest { /** * Query filters. */ query?: ShiftQuery | undefined; /** * number of resources in a page (200 by default). */ limit?: number | undefined; /** * opaque cursor for fetching the next page. */ cursor?: string | undefined; } /** * The response to a request for `Shift` objects. * Contains the requested `Shift` objects. May contain a set of `Error` objects if the request resulted in errors. */ export class SearchShiftsResponse { /** * Shifts. */ shifts?: Shift[] | undefined; /** * Opaque cursor for fetching the next page. */ cursor?: string | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Represents a set of SearchSubscriptionsQuery filters used to limit the set of Subscriptions returned by SearchSubscriptions. */ export class SearchSubscriptionsFilter { /** * A filter to select subscriptions based on the customer. */ customer_ids?: string[] | undefined; /** * A filter to select subscriptions based the location. */ location_ids?: string[] | undefined; } /** * Represents a query (including filtering criteria) used to search for subscriptions. */ export class SearchSubscriptionsQuery { /** * A list of filtering criteria. */ filter?: SearchSubscriptionsFilter | undefined; } /** * Defines parameters in a [SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint request. */ export class SearchSubscriptionsRequest { /** * A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; /** * The upper limit on the number of subscriptions to return in the response. Default: `200`. */ limit?: number | undefined; /** * Query subscriptions based on the given conditions and sort order. * Calling SearchSubscriptions without an explicit query parameter will return all subscriptions. */ query?: SearchSubscriptionsQuery | undefined; } /** * Defines the fields that are included in the response from the [SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint. */ export class SearchSubscriptionsResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The search result. */ subscriptions?: Subscription[] | undefined; /** * When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next * set of subscriptions. If empty, this is the final response. * For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). */ cursor?: string | undefined; } /** * 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 class SearchTeamMembersFilter { /** * When present, filter by team members assigned to the specified locations. When empty, include team members assigned to any location. */ "locationIds"?: string[] | undefined; /** * When present, filter by team members who match the given status. When empty, include team members of all statuses. * See [TeamMemberStatus](#type-teammemberstatus) for possible values. */ status?: string | undefined; } /** * Represents the parameters in a search for `TeamMember` objects. */ export class SearchTeamMembersQuery { /** * The options to filter by. */ filter?: SearchTeamMembersFilter | undefined; } /** * Represents a search request for a filtered list of `TeamMember` objects. */ export class SearchTeamMembersRequest { /** * The query parameters. */ query?: SearchTeamMembersQuery | undefined; /** * The maximum number of `TeamMember` objects in a page (25 by default). */ limit?: number | undefined; /** * The opaque cursor for fetching the next page. * Read about [pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) with Square APIs for more information. */ cursor?: string | undefined; } /** * Represents a response from a search request, containing a filtered list of `TeamMember` objects. */ export class SearchTeamMembersResponse { /** * The filtered list of `TeamMember` objects. */ team_members?: TeamMember[] | undefined; /** * The opaque cursor for fetching the next page. * Read about [pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) with Square APIs for more information. */ cursor?: string | undefined; /** * The errors that occurred during the request. */ errors?: Error[] | undefined; } export class SearchTerminalCheckoutsRequest { /** * Queries terminal checkouts based on given conditions and sort order. * Leaving this unset will return all checkouts with the default sort order. */ query?: TerminalCheckoutQuery | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; /** * Limit the number of results returned for a single request. */ limit?: number | undefined; } export class SearchTerminalCheckoutsResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested search result of `TerminalCheckout`s. */ checkouts?: TerminalCheckout[] | undefined; /** * The pagination cursor to be used in a subsequent request. If empty, this is the final response. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; } export class SearchTerminalRefundsRequest { /** * Query the terminal refunds based on given conditions and sort order. Calling `SearchTerminalRefunds` without * an explicitly query parameter will return all available refunds with the default sort order. */ query?: TerminalRefundQuery | undefined; /** * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for the original query. */ cursor?: string | undefined; /** * Limit the number of results returned for a single request. */ limit?: number | undefined; } export class SearchTerminalRefundsResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The requested search result of `TerminalRefund`s. */ refunds?: TerminalRefund[] | undefined; /** * The pagination cursor to be used in a subsequent request. If empty, this is the final response. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ cursor?: string | undefined; } /** * A record of the hourly rate, start, and end times for a single work shift for an employee. * May include a record of the start and end times for breaks taken during the shift. */ export class Shift { /** * UUID for this object. */ id?: string | undefined; /** * The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` instead */ employee_id?: string | undefined; /** * The ID of the location this shift occurred at. Should be based on where the employee clocked in. */ location_id?: string | undefined; /** * Read-only convenience value that is calculated from the location based on `location_id`. Format: the IANA * Timezone Database identifier for the location timezone. */ timezone?: string | undefined; /** * RFC 3339; shifted to location timezone + offset. Precision up to the minute is respected; seconds are truncated. */ start_at: string; /** * RFC 3339; shifted to timezone + offset. Precision up to the minute is respected; seconds are truncated. */ end_at?: string | undefined; /** * Job and pay related information. If wage is not set on create, will default to a wage of zero money. * If title is not set on create, will default to the name of the role the employee is assigned to, if any. */ wage?: ShiftWage | undefined; /** * A list of any paid or unpaid breaks that were taken during this shift. */ breaks?: ModelBreak[] | undefined; /** * Describes working state of the current `Shift`. See [ShiftStatus](#type-shiftstatus) for possible values. */ status?: "OPEN" | "CLOSED" | undefined; /** * Used for resolving concurrency issues; request will fail if version provided does not match server version at * time of request. If not provided, Square executes a blind write; potentially overwriting data from another write. */ version?: number | undefined; /** * A read-only timestamp in RFC 3339 format; presented in UTC. */ created_at?: string | undefined; /** * A read-only timestamp in RFC 3339 format; presented in UTC. */ updated_at?: string | undefined; /** * The ID of the team member this shift belongs to. Replaced `employee_id` at version \"2020-08-26\" */ team_member_id?: string | undefined; } /** * Defines a filter used in a search for `Shift` records. `AND` logic is used by Square's servers to apply each filter * property specified. */ export class ShiftFilter { /** * Fetch shifts for the specified location. */ location_ids: string[]; /** * Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` instead. */ employee_ids?: string[] | undefined; /** * Fetch a `Shift` instance by `Shift.status`. See [ShiftFilterStatus](#type-shiftfilterstatus) for possible values. */ status?: "OPEN" | "CLOSED" | undefined; /** * Fetch `Shift`s that start in the time range - Inclusive. */ start?: TimeRange | undefined; /** * Fetch the `Shift`s that end in the time range - Inclusive. */ end?: TimeRange | undefined; /** * Fetch the `Shift`s based on workday date range. */ workday?: ShiftWorkday | undefined; /** * Fetch shifts for the specified team members. Replaced `employee_ids` at version \"2020-08-26\" */ team_member_ids: string[]; } /** * Specifies the `status` of `Shift` records to be returned. */ export class ShiftFilterStatus {} /** * The parameters of a `Shift` search query. Includes filter and sort options. */ export class ShiftQuery { /** * Query filter options. */ filter?: ShiftFilter | undefined; /** * Sort order details. */ sort?: ShiftSort | undefined; } /** * Sets the sort order of search results. */ export class ShiftSort { /** * The field to sort on. See [ShiftSortField](#type-shiftsortfield) for possible values. */ field?: "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT" | undefined; /** * The order in which results are returned. Defaults to DESC. See [SortOrder](#type-sortorder) for possible values. */ order?: SortOrderType | undefined; } /** * Enumerates the `Shift` fields to sort on. */ export class ShiftSortField {} /** * Enumerates the possible status of a `Shift`. */ export class ShiftStatus {} /** * The hourly wage rate used to compensate an employee for this shift. */ export class ShiftWage { /** * The name of the job performed during this shift. Square labor-reporting UIs may group shifts together by title. */ title?: string | undefined; /** * Can be a custom-set hourly wage or the calculated effective hourly wage based on annual wage and hours worked per week. */ hourly_rate?: Money | undefined; } /** * 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. */ export class ShiftWorkday { /** * Dates for fetching the shifts */ date_range?: DateRange | undefined; /** * The strategy on which the dates are applied. See [ShiftWorkdayMatcher](#type-shiftworkdaymatcher) for possible values. */ match_shifts_by?: "START_AT" | "END_AT" | "INTERSECTION" | undefined; /** * Location-specific timezones convert workdays to datetime filters. * Every location included in the query must have a timezone, or this field must be provided as a fallback. * Format: the IANA timezone database identifier for the relevant timezone. */ default_timezone?: string | undefined; } /** * Defines the logic used to apply a workday filter. */ export class ShiftWorkdayMatcher {} /** * The order (e.g., chronological or alphabetical) in which results from a request are returned. */ export class SortOrder {} /** * Provides information about the application used to generate a change. */ export class SourceApplication { /** * Read-only `Product` type for the application. See [Product](#type-product) for possible values. */ product?: ProductSourceType | undefined; /** * Read-only Square ID assigned to the application. Only used for `Product` type `EXTERNAL_API`. */ application_id?: string | undefined; /** * Read-only display name assigned to the application (e.g. "Custom Application", "Square POS 4.74 for Android"). */ name?: string | undefined; } /** * Contains the name and abbreviation for standard measurement unit. */ export class StandardUnitDescription { /** * Identifies the measurement unit being described. */ unit?: MeasurementUnit | undefined; /** * UI display name of the measurement unit. For example, 'Pound'. */ name?: string | undefined; /** * UI display abbreviation for the measurement unit. For example, 'lb'. */ abbreviation?: string | undefined; } /** * Group of standard measurement units. */ export class StandardUnitDescriptionGroup { /** * List of standard (non-custom) measurement units in this description group. */ standard_unit_descriptions?: StandardUnitDescription[] | undefined; /** * IETF language tag. */ language_code?: string | undefined; } /** * Defines parameters for a SubmitEvidence request. */ export class SubmitEvidenceRequest {} /** * Defines fields in a SubmitEvidence response. */ export class SubmitEvidenceResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The `Dispute` for which evidence was submitted. */ dispute?: Dispute | undefined; } /** * Represents a customer subscription to a subscription plan. For an overview of the `Subscription` type, * see [Subscription object](/docs/subscriptions-api/overview#subscription-object-overview). */ export class Subscription { /** * The Square-assigned ID of the subscription. */ id?: string | undefined; /** * The ID of the location associated with the subscription. */ location_id?: string | undefined; /** * The ID of the associated `subscription plan`. */ plan_id?: string | undefined; /** * The ID of the associated `customer` profile. */ customer_id?: string | undefined; /** * The start date of the subscription, in YYYY-MM-DD format (for example, 2013-01-15). */ start_date?: string | undefined; /** * The subscription cancellation date, in YYYY-MM-DD format (for example, 2013-01-15). * On this date, the subscription status changes to `CANCELED` and the subscription billing stops. * If you don't set this field, the subscription plan dictates if and when subscription ends. * You cannot update this field, you can only clear it. */ canceled_date?: string | undefined; /** * The current status of the subscription. See [SubscriptionStatus](#type-subscriptionstatus) for possible values. */ status?: string | undefined; /** * The tax amount applied when billing the subscription. * The percentage is expressed in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. * For example, a value of `7.5` corresponds to 7.5%. */ tax_percentage?: string | undefined; /** * The IDs of the `invoices` created for the subscription, listed in order when the invoices were created (oldest invoices appear first). */ invoice_ids?: string[] | undefined; /** * A custom price to apply for the subscription. If specified, it overrides the price configured by the subscription plan. */ price_override_money?: Money | undefined; /** * The version of the object. When updating an object, the version supplied must match the version in the database, * otherwise the write will be rejected as conflicting. */ version?: number | undefined; /** * The timestamp when the subscription was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The ID of the `customer](#type-customer) [card` that is charged for the subscription. */ card_id?: string | undefined; /** * The date up to which the customer is invoiced for the subscription, in YYYY-MM-DD format (for example, 2013-01-15). * After the invoice is paid for a given billing period, this date will be the last day of the billing period. * For example, suppose for the month of May a customer gets an invoice (or charged the card) on May 1. * For the monthly billing scenario, this date is then set to May 31. */ paid_until_date?: string | undefined; /** * Timezone that will be used in date calculations for the subscription. * Defaults to the timezone of the location based on `location_id`. * Format: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`). */ timezone?: string | undefined; } /** * Determines the billing cadence of a `Subscription` */ export class SubscriptionCadence {} /** * Describes changes to subscription and billing states. */ export class SubscriptionEvent { /** * The ID of the subscription event. */ id: string; /** * Type of the subscription event. * See [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) for possible values. */ subscription_event_type: string; /** * The date, in YYYY-MM-DD format (for example, 2013-01-15), when the subscription event went into effect. */ effective_date: string; /** * The ID of the subscription plan associated with the subscription. */ plan_id: string; } /** * The possible subscription event types. */ export class SubscriptionEventSubscriptionEventType {} /** * Describes a phase in a subscription plan. For more information, see [Set Up and Manage a Subscription Plan](/docs/subscriptions-api/setup-plan). */ export class SubscriptionPhase { /** * The Square-assigned ID of the subscription phase. This field cannot be changed after a `SubscriptionPhase` is created. */ uid?: string | undefined; /** * The billing cadence of the phase. For example, weekly or monthly. * This field cannot be changed after a `SubscriptionPhase` is created. * See [SubscriptionCadence](#type-subscriptioncadence) for possible values. */ cadence: string; /** * The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. * This field cannot be changed after a `SubscriptionPhase` is created. */ periods?: number | undefined; /** * The amount to bill for each `cadence`. */ recurring_price_money: Money; /** * The position this phase appears in the sequence of phases defined for the plan, indexed from 0. * This field cannot be changed after a `SubscriptionPhase` is created. */ ordinal?: number | undefined; } /** * Possible subscription status values. */ export class SubscriptionStatus {} /** * When to calculate the taxes due on a cart. */ export class TaxCalculationPhase {} /** * Whether to the tax amount should be additional to or included in the CatalogItem price. */ export class TaxInclusionType {} /** * A record representing an individual team member for a business. */ export class TeamMember { /** * The unique ID for the team member. */ id?: string | undefined; /** * A second ID used to associate the team member with an entity in another system. */ reference_id?: string | undefined; /** * Whether the team member is the owner of the Square account. */ is_owner?: boolean | undefined; /** * Describes the status of the team member. See [TeamMemberStatus](#type-teammemberstatus) for possible values. */ status?: string | undefined; /** * The given (i.e., first) name associated with the team member. */ given_name?: string | undefined; /** * The family (i.e., last) name associated with the team member. */ family_name?: string | undefined; /** * The email address associated with the team member. */ email_address?: string | undefined; /** * The team member's phone number in E.164 format. * Examples: +14155552671 - the country code is 1 for US +551155256325 - the country code is 55 for BR. */ phone_number?: string | undefined; /** * The timestamp in RFC 3339 format describing when the team member was created. * Ex: \"2018-10-04T04:00:00-07:00\" or \"2019-02-05T12:00:00Z\" */ created_at?: string | undefined; /** * The timestamp in RFC 3339 format describing when the team member was last updated. * Ex: \"2018-10-04T04:00:00-07:00\" or \"2019-02-05T12:00:00Z\" */ updated_at?: string | undefined; /** * Describes the team member's assigned locations. */ assigned_locations?: TeamMemberAssignedLocations | undefined; } /** * An object that represents a team member's assignment to locations. */ export class TeamMemberAssignedLocations { /** * The current assignment type of the team member. * See [TeamMemberAssignedLocationsAssignmentType](#type-teammemberassignedlocationsassignmenttype) for possible values. */ assignment_type?: string | undefined; /** * The locations that the team member is assigned to. */ location_ids?: string[] | undefined; } /** * Enumerates the possible assignment types the team member can have */ export class TeamMemberAssignedLocationsAssignmentType {} /** * Enumerates the possible statuses the team member can have within a business. */ export class TeamMemberStatus {} /** * The hourly wage rate that a team member will earn on a `Shift` for doing the job specified by the `title` property of this object. */ export class TeamMemberWage { /** * UUID for this object. */ id?: string | undefined; /** * The `Team Member` that this wage is assigned to. */ team_member_id?: string | undefined; /** * The job title that this wage relates to. */ title?: string | undefined; /** * Can be a custom-set hourly wage or the calculated effective hourly wage based on annual wage and hours worked per week. */ hourly_rate?: Money | undefined; } /** * Represents a tender (i.e., a method of payment) used in a Square transaction. */ export class Tender { /** * The tender's unique ID. */ id?: string | undefined; /** * The ID of the transaction's associated location. */ location_id?: string | undefined; /** * The ID of the tender's associated transaction. */ transaction_id?: string | undefined; /** * The timestamp for when the tender was created, in RFC 3339 format. */ created_at?: string | undefined; /** * An optional note associated with the tender at the time of payment. */ note?: string | undefined; /** * The total amount of the tender, including `tip_money`. If the tender has a `payment_id`, the `total_money` of * the corresponding `Payment` will be equal to the `amount_money` of the tender. */ amount_money?: Money | undefined; /** * The tip's amount of the tender. */ tip_money?: Money | undefined; /** * The amount of any Square processing fees applied to the tender. This field is not immediately populated when a * new transaction is created. It is usually available after about ten seconds. */ processing_fee_money?: Money | undefined; /** * If the tender is associated with a customer or represents a customer's card on file, this is the ID of the * associated customer. */ customer_id?: string | undefined; /** * The type of tender, such as `CARD` or `CASH`. See [TenderType](#type-tendertype) for possible values. */ type: "CARD" | "CASH" | "THIRD_PARTY_CARD" | "SQUARE_GIFT_CARD" | "NO_SALE" | "OTHER"; /** * The details of the card tender. This value is present only if the value of `type` is `CARD`. */ card_details?: TenderCardDetails | undefined; /** * The details of the cash tender. This value is present only if the value of `type` is `CASH`. */ cash_details?: TenderCashDetails | undefined; /** * Additional recipients (other than the merchant) receiving a portion of this tender. * For example, fees assessed on the purchase by a third party integration. */ additional_recipients?: AdditionalRecipient[] | undefined; /** * The ID of the `Payment` that corresponds to this tender. This value is only present for payments created with the v2 Payments API. */ payment_id?: string | undefined; } /** * Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD`. */ export class TenderCardDetails { /** * The credit card payment's current state (such as `AUTHORIZED` or `CAPTURED`). * See `TenderCardDetailsStatus` for possible values. * See [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for possible values. */ status?: "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED" | undefined; /** * The credit card's non-confidential details. */ card?: Card | undefined; /** * The method used to enter the card's details for the transaction. * See [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) for possible values. */ entry_method?: "SWIPED" | "KEYED" | "EMV" | "ON_FILE" | "CONTACTLESS" | undefined; } /** * Indicates the method used to enter the card's details. */ export class TenderCardDetailsEntryMethod {} /** * Indicates the card transaction's current status. */ export class TenderCardDetailsStatus {} /** * Represents the details of a tender with `type` `CASH`. */ export class TenderCashDetails { /** * The total amount of cash provided by the buyer, before change is given. */ buyer_tendered_money?: Money | undefined; /** * The amount of change returned to the buyer. */ change_back_money?: Money | undefined; } /** * Indicates a tender's type. */ export class TenderType {} export class TerminalCheckout { /** * A unique ID for this `TerminalCheckout` */ id?: string | undefined; /** * The amount of money (including tax amount) that the Square Terminal device should try to collect. */ amount_money: Money; /** * An optional user-defined reference ID which can be used to associate this `TerminalCheckout` to another entity in an external system. * For example, an order ID generated by a third-party shopping cart. Will also be associated with any payments used to complete the checkout. */ reference_id?: string | undefined; /** * An optional note to associate with the checkout, as well any payments used to complete the checkout. */ note?: string | undefined; /** * Options to control the display and behavior of the Square Terminal device. */ device_options: DeviceCheckoutOptions; /** * The duration as an RFC 3339 duration, after which the checkout will be automatically canceled. * TerminalCheckouts that are `PENDING` will be automatically `CANCELED` and have a cancellation reason of `TIMED\\_OUT`. * Default: 5 minutes from creation. Maximum: 5 minutes. */ deadline_duration?: string | undefined; /** * The status of the `TerminalCheckout`. Options: `PENDING`, `IN\\_PROGRESS`, `CANCEL\\_REQUESTED`, `CANCELED`, `COMPLETED` */ status?: string | undefined; /** * Present if the status is `CANCELED`. See [ActionCancelReason](#type-actioncancelreason) for possible values */ cancel_reason?: string | undefined; /** * A list of ids for payments created by this `TerminalCheckout`. */ payment_ids?: string[] | undefined; /** * The time when the `TerminalCheckout` was created as an RFC 3339 timestamp. */ created_at?: string | undefined; /** * The time when the `TerminalCheckout` was last updated as an RFC 3339 timestamp. */ updated_at?: string | undefined; } export class TerminalCheckoutQuery { /** * Options for filtering returned `TerminalCheckout`s */ filter?: TerminalCheckoutQueryFilter | undefined; /** * Option for sorting returned `TerminalCheckout`s */ sort?: TerminalCheckoutQuerySort | undefined; } export class TerminalCheckoutQueryFilter { /** * `TerminalCheckout`s associated with a specific device. * If no device is specified then all `TerminalCheckout`s for the merchant will be displayed. */ device_id?: string | undefined; /** * Time range for the beginning of the reporting period. Inclusive. Default: The current time minus one day. */ created_at?: TimeRange | undefined; /** * Filtered results with the desired status of the `TerminalCheckout` Options: PENDING, IN\\_PROGRESS, CANCELED, COMPLETED */ status?: string | undefined; } export class TerminalCheckoutQuerySort { /** * The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). */ sort_order?: string | undefined; } export class TerminalRefund { /** * A unique ID for this `TerminalRefund` */ id?: string | undefined; /** * The reference to the payment refund created by completing this `TerminalRefund`. */ refund_id?: string | undefined; /** * Unique ID of the payment being refunded. */ payment_id: string; /** * The reference to the Square order id for the payment identified by the `payment_id`. */ order_id?: string | undefined; /** * The amount of money, inclusive of `tax_money`, that the `TerminalRefund` should return. * This value is limited to the amount taken in the original payment minus any completed or pending refunds. */ amount_money: Money; /** * A description of the reason for the refund. Note: maximum 192 characters. */ reason?: string | undefined; /** * The unique Id of the device intended for this `TerminalRefund`. The Id can be retrieved from /v2/devices api. */ device_id?: string | undefined; /** * The duration as an RFC 3339 duration, after which the refund will be automatically canceled. * TerminalRefunds that are `PENDING` will be automatically `CANCELED` and have a cancellation reason of `TIMED_OUT` * Default: 5 minutes from creation. Maximum: 5 minutes. */ deadline_duration?: string | undefined; /** * The status of the `TerminalRefund`. Options: `PENDING`, `IN\\_PROGRESS`, `CANCELED`, `COMPLETED` */ status?: string | undefined; /** * Present if the status is `CANCELED`. See [ActionCancelReason](#type-actioncancelreason) for possible values. */ cancel_reason?: string | undefined; /** * The time when the `TerminalRefund` was created as an RFC 3339 timestamp. */ created_at?: string | undefined; /** * The time when the `TerminalRefund` was last updated as an RFC 3339 timestamp. */ updated_at?: string | undefined; } export class TerminalRefundQuery { filter?: TerminalRefundQueryFilter | undefined; sort?: TerminalRefundQuerySort | undefined; } export class TerminalRefundQueryFilter { /** * `TerminalRefund`s associated with a specific device. * If no device is specified then all `TerminalRefund`s for the signed in account will be displayed. */ device_id?: string | undefined; /** * Timestamp for the beginning of the reporting period, in RFC 3339 format. Inclusive. Default: The current time minus one day. */ created_at?: TimeRange | undefined; /** * Filtered results with the desired status of the `TerminalRefund` * Options: `PENDING`, `IN\\_PROGRESS`, `CANCEL\\_REQUESTED`, `CANCELED`, `COMPLETED` */ status?: string | undefined; } export class TerminalRefundQuerySort { /** * The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). */ sort_order?: string | undefined; } /** * 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 class TimeRange { /** * A datetime value in RFC 3339 format indicating when the time range starts. */ start_at?: string | undefined; /** * A datetime value in RFC 3339 format indicating when the time range ends. */ end_at?: string | undefined; } export class TipSettings { /** * Indicates whether tipping is enabled for this checkout. Defaults to false. */ allow_tipping?: boolean | undefined; /** * Indicates whether tip options should be presented on their own screen before presenting the signature * screen during card payment. Defaults to false. */ separate_tip_screen?: boolean | undefined; /** * Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false. */ custom_tip_field?: boolean | undefined; } /** * 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 class Transaction { /** * The transaction's unique ID, issued by Square payments servers. */ id?: string | undefined; /** * The ID of the transaction's associated location. */ location_id?: string | undefined; /** * The timestamp for when the transaction was created, in RFC 3339 format. */ created_at?: string | undefined; /** * The tenders used to pay in the transaction. */ tenders?: Tender[] | undefined; /** * Refunds that have been applied to any tender in the transaction. */ refunds?: Refund[] | undefined; /** * If the transaction was created with the `Charge` endpoint, this value is the same as the value provided for * the `reference_id` parameter in the request to that endpoint. Otherwise, it is not set. */ reference_id?: string | undefined; /** * The Square product that processed the transaction. See [TransactionProduct](#type-transactionproduct) for possible values. */ product?: | "REGISTER" | "EXTERNAL_API" | "BILLING" | "APPOINTMENTS" | "INVOICES" | "ONLINE_STORE" | "PAYROLL" | "OTHER" | undefined; /** * If the transaction was created in the Square Point of Sale app, this value is the ID generated for the * transaction by Square Point of Sale. This ID has no relationship to the transaction's canonical `id`, which is * generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction * cannot immediately be completed (for example, if the transaction is processed in offline mode). * It is not currently possible with the Connect API to perform a transaction lookup by this value. */ client_id?: string | undefined; /** * The shipping address provided in the request, if any. */ shipping_address?: Address | undefined; /** * The order_id is an identifier for the order associated with this transaction, if any. */ order_id?: string | undefined; } /** * Indicates the Square product used to process a transaction. */ export class TransactionProduct {} /** * Transaction type used in the disputed payment. */ export class TransactionType {} /** * A request to update a `BreakType` */ export class UpdateBreakTypeRequest { /** * The updated `BreakType`. */ break_type: BreakType; } /** * A response to a request to update a `BreakType`. Contains the requested `BreakType` objects. May contain a set of * `Error` objects if the request resulted in errors. */ export class UpdateBreakTypeResponse { /** * The response object. */ break_type?: BreakType | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines the body parameters that can be provided in a request to the [UpdateCustomerGroup](#endpoint-updatecustomergroup) endpoint. */ export class UpdateCustomerGroupRequest { /** * The `CustomerGroup` object including all the updates you want to make. */ group: CustomerGroup; } /** * Defines the fields that are included in the response body of a request to the [UpdateCustomerGroup](#endpoint-updatecustomergroup) endpoint. * One of `errors` or `group` is present in a given response (never both). */ export class UpdateCustomerGroupResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The successfully updated customer group. */ group?: CustomerGroup | undefined; } /** * Defines the body parameters that can be provided in a request to the UpdateCustomer endpoint. */ export class UpdateCustomerRequest { /** * The given (i.e., first) name associated with the customer profile. */ given_name?: string | undefined; /** * The family (i.e., last) name associated with the customer profile. */ family_name?: string | undefined; /** * A business name associated with the customer profile. */ company_name?: string | undefined; /** * A nickname for the customer profile. */ nickname?: string | undefined; /** * The email address associated with the customer profile. */ email_address?: string | undefined; /** * The physical address associated with the customer profile. */ address?: Address | undefined; /** * The 11-digit phone number associated with the customer profile. */ phone_number?: string | undefined; /** * An optional, second ID used to associate the customer profile with an entity in another system. */ reference_id?: string | undefined; /** * A custom note associated with the customer profile. */ note?: string | undefined; /** * The birthday associated with the customer profile, in RFC 3339 format. Year is optional, timezone and times are not allowed. * For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st. * `1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. */ birthday?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the UpdateCustomer endpoint. * One of `errors` or `customer` is present in a given response (never both). */ export class UpdateCustomerResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The updated customer. */ customer?: Customer | undefined; } /** * Describes a `UpdateInvoice` request. */ export class UpdateInvoiceRequest { /** * The invoice fields to update. You need to only specify the fields you want to change. * The current invoice version must be specified in the `version` field. * For more information, see [Update an invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#update-an-invoice). */ invoice: Invoice; /** * A unique string that identifies the `UpdateInvoice` request. If you do not provide `idempotency_key` * (or provide an empty string as the value), the endpoint treats each request as independent. * For more information, see [Idempotency](https://developer.squareup.com/docs/docs/working-with-apis/idempotency). */ idempotency_key?: string | undefined; /** * List of fields to clear. * For examples, see [Update an invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#update-an-invoice). */ fields_to_clear?: string[] | undefined; } /** * Describes a `UpdateInvoice` response. */ export class UpdateInvoiceResponse { /** * The updated invoice. */ invoice?: Invoice | undefined; /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; } export class UpdateItemModifierListsRequest { /** * The IDs of the catalog items associated with the CatalogModifierList objects being updated. */ item_ids: string[]; /** * The IDs of the CatalogModifierList objects to enable for the CatalogItem. */ modifier_lists_to_enable?: string[] | undefined; /** * The IDs of the CatalogModifierList objects to disable for the CatalogItem. */ modifier_lists_to_disable?: string[] | undefined; } export class UpdateItemModifierListsResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-date) of this * update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. */ updated_at?: string | undefined; } export class UpdateItemTaxesRequest { /** * IDs for the CatalogItems associated with the CatalogTax objects being updated. */ item_ids: string[]; /** * IDs of the CatalogTax objects to enable. */ taxes_to_enable?: string[] | undefined; /** * IDs of the CatalogTax objects to disable. */ taxes_to_disable?: string[] | undefined; } export class UpdateItemTaxesResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update * in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. */ updated_at?: string | undefined; } /** * Request object for the [UpdateLocation](#endpoint-updatelocation) endpoint. */ export class UpdateLocationRequest { /** * The `Location` object with only the fields to update. */ location?: Location | undefined; } /** * Response object returned by the [UpdateLocation](#endpoint-updatelocation) endpoint. */ export class UpdateLocationResponse { /** * Information on errors encountered during the request. */ errors?: Error[] | undefined; /** * The updated `Location`. */ location?: Location | undefined; } /** * Defines the fields that are included in requests to the [UpdateOrder](#endpoint-orders-updateorder) endpoint. */ export class UpdateOrderRequest { /** * The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders#sparse-order-objects) containing * only the fields to update and the version the update is being applied to. */ order?: Order | undefined; /** * The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation) fields to clear. * For example, `line_items[uid].note` [Read more about Deleting fields](https://developer.squareup.com/docs/orders-api/manage-orders#delete-fields). */ fields_to_clear?: string[] | undefined; /** * A value you specify that uniquely identifies this update request If you're unsure whether a particular update was * applied to an order successfully, you can reattempt it with the same idempotency key without worrying about creating * duplicate updates to the order. The latest order version will be returned. * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ idempotency_key?: string | undefined; } /** * Defines the fields that are included in the response body of a request to the [UpdateOrder](#endpoint-orders-updateorder) endpoint. */ export class UpdateOrderResponse { /** * The updated Order. */ order?: Order | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * A request to update a `Shift` object. */ export class UpdateShiftRequest { /** * The updated `Shift` object. */ shift: Shift; } /** * The response to a request to update a `Shift`. * Contains the updated `Shift` object. May contain a set of `Error` objects if the request resulted in errors. */ export class UpdateShiftResponse { /** * The updated `Shift`. */ shift?: Shift | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Defines parameters in a [UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint request. */ export class UpdateSubscriptionRequest { /** * The subscription object containing the current version, and fields to update. Unset fields will be left at their * current server values, and JSON `null` values will be treated as a request to clear the relevant data. */ subscription?: Subscription | undefined; } /** * Defines the fields that are included in the response from the [UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint. */ export class UpdateSubscriptionResponse { /** * Information about errors encountered during the request. */ errors?: Error[] | undefined; /** * The modified `Subscription` object. */ subscription?: Subscription | undefined; } /** * Represents an update request for a `TeamMember` object. */ export class UpdateTeamMemberRequest { /** * The data which will be used to update the `TeamMember` object. */ team_member?: TeamMember | undefined; } /** * Represents a response from an update request, containing the updated `TeamMember` object or error messages. */ export class UpdateTeamMemberResponse { /** * The successfully updated `TeamMember` object. */ team_member?: TeamMember | undefined; /** * The errors that occurred during the request. */ errors?: Error[] | undefined; } /** * Represents an update request for the `WageSetting` object describing a `TeamMember`. */ export class UpdateWageSettingRequest { /** * The new `WageSetting` object that will completely replace the existing one. */ wage_setting: WageSetting; } /** * Represents a response from an update request, containing the updated `WageSetting` object or error messages. */ export class UpdateWageSettingResponse { /** * The successfully updated `WageSetting` object. */ wage_setting?: WageSetting | undefined; /** * The errors that occurred during the request. */ errors?: Error[] | undefined; } /** * A request to update a `WorkweekConfig` object */ export class UpdateWorkweekConfigRequest { /** * The updated `WorkweekConfig` object. */ workweek_config: WorkweekConfig; } /** * The response to a request to update a `WorkweekConfig` object. Contains the updated `WorkweekConfig` object. * May contain a set of `Error` objects if the request resulted in errors. */ export class UpdateWorkweekConfigResponse { /** * The response object. */ workweek_config?: WorkweekConfig | undefined; /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } export class UpsertCatalogObjectRequest { /** * A value you specify that uniquely identifies this request among all your requests. * A common way to create a valid idempotency key is to use a Universally unique identifier (UUID). * If you're unsure whether a particular request was successful, you can reattempt it with the same idempotency key * without worrying about creating duplicate objects. * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ idempotency_key: string; /** * A CatalogObject to be created or updated. * - For updates, the object must be active (the `is_deleted` field is not `true`). * - For creates, the object ID must start with `#`. * The provided ID is replaced with a server-generated ID. */ object: CatalogObject; } export class UpsertCatalogObjectResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; /** * The successfully created or updated CatalogObject. */ catalog_object?: CatalogObject | undefined; /** * The mapping between client and server IDs for this upsert. */ id_mappings?: CatalogIdMapping[] | undefined; } /** * 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 class VersionedCatalogObject { /** * The ID of the referenced object. */ object_id?: string | undefined; /** * The version of the object. */ catalog_version?: number | undefined; } /** * Defines the request body for calls to the VoidTransaction endpoint. */ export class VoidTransactionRequest {} /** * Defines the fields that are included in the response body of a request to the [VoidTransaction](#endpoint-voidtransaction) endpoint. */ export class VoidTransactionResponse { /** * Any errors that occurred during the request. */ errors?: Error[] | undefined; } /** * An object representing a team member's wage information. */ export class WageSetting { /** * The unique ID of the `TeamMember` whom this wage setting describes. */ team_member_id?: string | undefined; /** * The ordered list of jobs that the team member is assigned to. * The first job assignment is considered the team member's \"Primary Job\".
Min Length 1 Max Length 12 */ job_assignments: JobAssignment[]; /** * Whether the team member is exempt from the overtime rules of the seller country. */ is_overtime_exempt?: boolean | undefined; /** * Used for resolving concurrency issues; request will fail if version provided does not match server version at time of request. * If not provided, Square executes a blind write, potentially overwriting data from another write. * Read about [optimistic concurrency](https://developer.squareup.com/docs/docs/working-with-apis/optimistic-concurrency) * in Square APIs for more information. */ version?: number | undefined; /** * The timestamp in RFC 3339 format describing when the wage setting object was created. * Ex: \"2018-10-04T04:00:00-07:00\" or \"2019-02-05T12:00:00Z\" */ created_at?: string | undefined; /** * The timestamp in RFC 3339 format describing when the wage setting object was last updated. * Ex: \"2018-10-04T04:00:00-07:00\" or \"2019-02-05T12:00:00Z\" */ updated_at?: string | undefined; } /** * The days of the week. */ export class Weekday {} /** * Sets the Day of the week and hour of the day that a business starts a work week. Used for the calculation of overtime pay. */ export class WorkweekConfig { /** * UUID for this object */ id?: string | undefined; /** * The day of the week on which a business week cuts over for compensation purposes. * See [Weekday](#type-weekday) for possible values. */ start_of_week: DayOfWeekType; /** * The local time at which a business week cuts over. Represented as a string in `HH:MM` format (`HH:MM:SS` is also * accepted, but seconds are truncated). */ start_of_day_local_time: string; /** * Used for resolving concurrency issues; request will fail if version provided does not match server version at * time of request. If not provided, Square executes a blind write; potentially overwriting data from another write. */ version?: number | undefined; /** * A read-only timestamp in RFC 3339 format; presented in UTC. */ created_at?: string | undefined; /** * A read-only timestamp in RFC 3339 format; presented in UTC. */ updated_at?: string | undefined; } /** * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. The * contents of this file should be regarded as internal but are documented for completeness. */ export class ApiClient { /** * The base URL against which to resolve every API call's (relative) path. */ basePath: string; /** * The authentication methods to be included for all API calls. */ authentications: { oauth2: { type: string; accessToken: string; }; oauth2ClientSecret: { type: string; in: string; name: string; }; }; /** * The default HTTP headers to be included for all API calls. */ defaultHeaders: { [key: string]: string }; /** * The default HTTP timeout for all API calls. */ timeout: number; /** * If set to false an additional timestamp parameter is added to all API GET calls to prevent browser caching. */ cache: boolean; /** * If set to true, the client will save the cookies from each server response, and return them in the next request. */ enableCookies: boolean; /** * The default API client implementation. */ static instance: ApiClient; } export class ApplePayApi { /** * Constructs a new ApplePayApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple * to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform * developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about * Apple Pay on Web see the Apple Pay section in the [Square Payment Form Walkthrough](/docs/payment-form/payment-form-walkthrough). */ registerDomain(...args: any[]): Promise; } // @todo describe methods export class BankAccountsApi {} // @todo describe methods export class CashDrawersApi {} export class CatalogApi { /** * Constructs a new CatalogApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Returns a list of [CatalogObject](#type-catalogobject)s that includes all objects of a set of desired types * (for example, all [CatalogItem](#type-catalogitem) and [CatalogTax](#type-catalogtax) objects) in the catalog. * The `types` parameter is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) * types: `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`. * @note ListCatalog does not return deleted catalog items. To retrieve deleted catalog items, use SearchCatalogObjects * and set `include_deleted_objects` to `true`. */ batchDeleteCatalogObjects(...args: any[]): Promise; /** * Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of * its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its * [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. */ batchRetrieveCatalogObjects(...args: any[]): Promise; /** * Creates or updates up to 10,000 target objects based on the provided list of objects. The target objects are grouped into * batches and each batch is inserted/updated in an all-or-nothing manner. If an object within a batch is malformed in some way, * or violates a database constraint, the entire batch containing that item will be disregarded. However, other batches in * the same request may still succeed. Each batch may contain up to 1,000 objects, and batches will be processed in order as long * as the total object count for the request (items, variations, modifier lists, discounts, and taxes) is no more than 10,000. */ batchUpsertCatalogObjects(...args: any[]): Promise; /** * Returns information about the Square Catalog API, such as batch size limits for `BatchUpsertCatalogObjects`. */ catalogInfo(...args: any[]): Promise; /** * Deletes a single [CatalogObject](#type-catalogobject) based on the provided ID and returns the set of successfully deleted * IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. * For example, deleting a [CatalogItem](#type-catalogitem) will also delete all of its * [CatalogItemVariation](#type-catalogitemvariation) children. */ deleteCatalogObject(...args: any[]): Promise; /** * Returns a list of [CatalogObject](#type-catalogobject)s that includes all objects of a set of desired types (for example, * all [CatalogItem](#type-catalogitem) and [CatalogTax](#type-catalogtax) objects) in the catalog. * The `types` parameter is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) * types: `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`. * @note ListCatalog does not return deleted catalog items. * To retrieve deleted catalog items, use SearchCatalogObjects and set `include_deleted_objects` to `true`. */ listCatalog(...args: any[]): Promise; /** * Returns a single [CatalogItem](#type-catalogitem) as a [CatalogObject](#type-catalogobject) based on the provided ID. * The returned object includes all of the relevant [CatalogItem](#type-catalogitem) information including: * [CatalogItemVariation](#type-catalogitemvariation) children, references to its [CatalogModifierList](#type-catalogmodifierlist) * objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. */ retrieveCatalogObject(...args: any[]): Promise; /** * Queries the targeted catalog using a variety of query types: [CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), * [CatalogQueryExact](#type-catalogqueryexact), [CatalogQueryRange](#type-catalogqueryrange), * [CatalogQueryText](#type-catalogquerytext), [CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), * and [CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist). * Future end of the above comment: [CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), * [CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist), * [CatalogQueryItemsForItemOptions](#type-catalogqueryitemsforitemoptions), * and [CatalogQueryItemVariationsForItemOptionValues](#type-catalogqueryitemvariationsforitemoptionvalues). */ searchCatalogObjects(...args: any[]): Promise; /** * Updates the [CatalogModifierList](#type-catalogmodifierlist) objects that apply to the targeted * [CatalogItem](#type-catalogitem) without having to perform an upsert on the entire item. */ updateItemModifierLists(...args: any[]): Promise; /** * Updates the [CatalogTax](#type-catalogtax) objects that apply to the targeted [CatalogItem](#type-catalogitem) * without having to perform an upsert on the entire item. */ updateItemTaxes(...args: any[]): Promise; /** * Creates or updates the target [CatalogObject](#type-catalogobject). */ upsertCatalogObject(...args: any[]): Promise; } export class CheckoutApi { /** * Constructs a new CheckoutApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Links a `checkoutId` to a `checkout_page_url` that customers will be directed to in order to provide their payment * information using a payment processing workflow hosted on connect.squareup.com. */ createCheckout(locationId: string, body: CreateCheckoutRequest): Promise; } // @todo describe methods export class CustomerGroupsApi {} // @todo describe methods export class CustomerSegmentsApi {} export class CustomersApi { /** * Constructs a new CustomersApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Creates a new customer for a business, which can have associated cards on file. You must provide at least one of the * following values in your request to this endpoint: `given_name`. `family_name`, `company_name`, `email_address`,`phone_number`. */ createCustomer(body: CreateCustomerRequest): Promise; /** * Adds a card on file to an existing customer. As with charges, calls to `CreateCustomerCard` are idempotent. * Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. */ createCustomerCard(customerId: string, body: CreateCustomerCardRequest): Promise; /** * Deletes a customer from a business, along with any linked cards on file. * When two profiles are merged into a single profile, that profile is assigned a new `customer_id`. * You must use the new `customer_id` to delete merged profiles. */ deleteCustomer(...args: any[]): Promise; /** * Removes a card on file from a customer. */ deleteCustomerCard(customerId: string, cardId: string): Promise; /** * Lists a business's customers. */ listCustomers(...args: any[]): Promise; /** * Returns details for a single customer. */ retrieveCustomer(customerId: string): Promise; /** * Searches the customer profiles associated with a Square account. * Calling SearchCustomers without an explicit query parameter returns all customer profiles ordered alphabetically based * on `given_name` and `family_name`. */ searchCustomers(...args: any[]): Promise; /** * Updates the details of an existing customer. When two profiles are merged into a single profile, that profile * is assigned a new `customer_id`. You must use the new `customer_id` to update merged profiles. You cannot edit * a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing * card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with * the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. */ updateCustomer(...args: any[]): Promise; } // @todo describe methods export class DevicesApi {} // @todo describe methods export class DisputesApi {} export class EmployeesApi { /** * Constructs a new EmployeesApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Gets a list of `Employee` objects for a business. */ listEmployees(params: ListEmployeesRequest): Promise; /** * Gets an `Employee` by Square-assigned employee `ID` (UUID). */ retrieveEmployee(id: string): Promise; } // @todo describe methods export class InvoicesApi {} export class InventoryApi { /** * Constructs a new InventoryApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Applies adjustments and counts to the provided item quantities. * On success: returns the current calculated counts for all objects referenced in the request. * On failure: returns a list of related errors. */ batchChangeInventory(...args: any[]): Promise; /** * Returns historical physical counts and adjustments based on the provided filter criteria. * Results are paginated and sorted in ascending order according their `occurred_at` timestamp (oldest first). * BatchRetrieveInventoryChanges is a catch-all query endpoint for queries that cannot be handled by other, simpler endpoints. */ batchRetrieveInventoryChanges(...args: any[]): Promise; /** * Returns current counts for the provided [CatalogObject](#type-catalogobject)s at the requested [Location](#type-location)s. * Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). * When `updated_after` is specified, only counts that have changed since that time (based on the server timestamp for * the most recent change) are returned. This allows clients to perform a "sync" operation, for example in response to * receiving a Webhook notification. */ batchRetrieveInventoryCounts(...args: any[]): Promise; /** * Returns the [InventoryAdjustment](#type-inventoryadjustment) object with the provided `adjustment_id`. */ retrieveInventoryAdjustment(...args: any[]): Promise; /** * Returns a set of physical counts and inventory adjustments for the provided [CatalogObject](#type-catalogobject) at the * requested [Location](#type-location)s. Results are paginated and sorted in descending order according to their * `occurred_at` timestamp (newest first). There are no limits on how far back the caller can page. * This endpoint is useful when displaying recent changes for a specific item. For more sophisticated queries, * use a batch endpoint. */ retrieveInventoryChanges(...args: any[]): Promise; /** * Retrieves the current calculated stock count for a given [CatalogObject](#type-catalogobject) at a given set * of [Location](#type-location)s. Responses are paginated and unsorted. For more sophisticated queries, use a batch endpoint. */ retrieveInventoryCount(...args: any[]): Promise; /** * Returns the [InventoryPhysicalCount](#type-inventoryphysicalcount) object with the provided `physical_count_id`. */ retrieveInventoryPhysicalCount(...args: any[]): Promise; } export class LaborApi { /** * Constructs a new LaborApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Creates a new `BreakType`. A `BreakType` is a template for creating `Break` objects. * You must provide the following values in your request to this endpoint: * - `location_id` - `break_name` - `expected_duration` - `is_paid` * You can only have 3 `BreakType` instances per location. If you attempt to add a 4th `BreakType` for a location, * an `INVALID_REQUEST_ERROR` "Exceeded limit of 3 breaks per location." is returned. */ createBreakType(...args: any[]): Promise; /** * Creates a new `Shift`. A `Shift` represents a complete work day for a single employee. * You must provide the following values in your request to this endpoint: * - `location_id` - `employee_id` - `start_at` * An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: - The `status` of the new `Shift` * is `OPEN` and the employee has another shift with an `OPEN` status. - The `start_at` date is in the future - the * `start_at` or `end_at` overlaps another shift for the same employee - If `Break`s are set in the request, a break * `start_at` must not be before the `Shift.start_at`. A break `end_at` must not be after the `Shift.end_at`. */ createShift(...args: any[]): Promise; /** * Deletes an existing `BreakType`. A `BreakType` can be deleted even if it is referenced from a `Shift`. */ deleteBreakType(...args: any[]): Promise; /** * Deletes a `Shift`. */ deleteShift(...args: any[]): Promise; /** * Returns a single `BreakType` specified by id. */ getBreakType(...args: any[]): Promise; /** * Returns a single `EmployeeWage` specified by id. */ getEmployeeWage(...args: any[]): Promise; /** * Returns a single `Shift` specified by id. */ getShift(...args: any[]): Promise; /** * Returns a paginated list of `BreakType` instances for a business. */ listBreakTypes(...args: any[]): Promise; /** * Returns a paginated list of `EmployeeWage` instances for a business. */ listEmployeeWages(...args: any[]): Promise; /** * Returns a list of `WorkweekConfig` instances for a business. */ listWorkweekConfigs(...args: any[]): Promise; /** * Returns a paginated list of `Shift` records for a business. * The list to be returned can be filtered by: - Location IDs **and** - employee IDs **and** - shift * status (`OPEN`, `CLOSED`) **and** - shift start **and** - shift end **and** - work day details. * The list can be sorted by: - `start_at` - `end_at` - `created_at` - `updated_at`. */ searchShifts(...args: any[]): Promise; /** * Updates an existing `BreakType`. */ updateBreakType(...args: any[]): Promise; /** * Updates an existing `Shift`. When adding a `Break` to a `Shift`, any earlier `Breaks` in the `Shift` have * the `end_at` property set to a valid RFC-3339 datetime string. When closing a `Shift`, all `Break` instances * in the shift must be complete with `end_at` set on each `Break`. */ updateShift(...args: any[]): Promise; /** * Updates a `WorkweekConfig`. */ updateWorkweekConfig(...args: any[]): Promise; } export class LocationsApi { /** * Constructs a new LocationsApi. * @param apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient?: ApiClient); /** * Provides the details for all of a business's locations. * Most other Connect API endpoints have a required `location_id` path parameter. The `id` field of the * [`Location`](#type-location) objects returned by this endpoint correspond to that `location_id` parameter. */ listLocations(): Promise; /** * Creates a location. */ createLocation(body: Location): Promise; /** * Retrieves details of a location. */ retrieveLocation(locationId: string): Promise; /** * Updates a location. */ updateLocation(locationId: string, body: Location): Promise; } // @todo describe methods export class LoyaltyApi {} // @todo describe methods export class MerchantsApi {} export class MobileAuthorizationApi { /** * Constructs a new MobileAuthorizationApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Generates code to authorize a mobile application to connect to a Square card reader Authorization codes are * one-time-use and expire __60 minutes__ after being issued. * @note The `Authorization` header you provide to this endpoint must have the following format: * `Authorization: Bearer ACCESS_TOKEN` Replace `ACCESS_TOKEN` with a [valid production authorization credential] * @link https://docs.connect.squareup.com/get-started#step-4-understand-the-different-application-credentials */ createMobileAuthorizationCode( body: CreateMobileAuthorizationCodeRequest, ): Promise; } export class OAuthApi { /** * Constructs a new OAuthApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Returns an OAuth access token. The endpoint supports distinct methods of obtaining OAuth access tokens. * Applications specify a method by adding the `grant_type` parameter in the request and also provide relevant information. * For more information, see [OAuth access token management](/authz/oauth/how-it-works#oauth-access-token-management). * @note Regardless of the method application specified, the endpoint always returns two items; an OAuth access token and * a refresh token in the response. __OAuth tokens should only live on secure servers. Application clients should never * interact directly with OAuth tokens__. */ obtainToken(body: ObtainTokenRequest): Promise; /** * `RenewToken` is deprecated. For information about refreshing OAuth access tokens, * see [Renew OAuth Token](https://developer.squareup.com/docs/oauth-api/cookbook/renew-oauth-tokens). * Renews an OAuth access token before it expires. OAuth access tokens besides your application's personal access * token expire after __30 days__. You can also renew expired tokens within __15 days__ of their expiration. * You cannot renew an access token that has been expired for more than 15 days. Instead, the associated user * must re-complete the OAuth flow from the beginning. * @note The `Authorization` header for this endpoint must have the following format: * ``` Authorization: Client APPLICATION_SECRET ``` Replace `APPLICATION_SECRET` * with the application secret on the Credentials page in the [application dashboard](https://connect.squareup.com/apps). */ renewToken(clientId: string, body: RenewTokenRequest): Promise; /** * Revokes an access token generated with the OAuth flow. If an account has more than one OAuth access token for * your application, this endpoint revokes all of them, regardless of which token you specify. When an OAuth access * token is revoked, all of the active subscriptions associated with that OAuth token are canceled immediately. * @note The `Authorization` header for this endpoint must have the following format: * ``` Authorization: Client APPLICATION_SECRET ``` Replace `APPLICATION_SECRET` with the application secret on the * Credentials page in the [application dashboard](https://connect.squareup.com/apps). */ revokeToken(body: RevokeTokenRequest): Promise; } export class OrdersApi { /** * Constructs a new OrdersApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Retrieves a set of [Order](#type-order)s by their IDs. * If a given Order ID does not exist, the ID is ignored instead of generating an error. */ batchRetrieveOrders(body: BatchRetrieveOrdersRequest): Promise; /** * Calculates an [Order](#type-order). */ calculateOrder(body: CalculateOrderRequest): Promise; /** * Creates an [Order](#type-order) that can then be referenced as `order_id` in a request to the [Charge](#endpoint-charge) * endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. * To associate a created order with a request to the Charge endpoint, provide the order's `id` in the `order_id` field of * your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order * with modified details. To learn more about the Orders API, see the [Orders API Overview](/products/orders/overview). */ createOrder(body: CreateOrderRequest): Promise; /** * Pay for an [order](#type-order) using one or more approved [payments](#type-payment), or settle an order with a total of `0`. * The total of the `payment_ids` listed in the request must be equal to the order total. Orders with a total amount * of `0` can be marked as paid by specifying an empty array of `payment_ids` in the request. To be used with PayOrder, * a payment must: - Reference the order by specifying the `order_id` when [creating the payment](#endpoint-payments-createpayment). * Any approved payments that reference the same `order_id` not specified in the `payment_ids` will be canceled. * - Be approved with [delayed capture](/payments-api/take-payments#delayed-capture). Using a delayed capture payment * with PayOrder will complete the approved payment. */ payOrder(orderId: string, body: PayOrderRequest): Promise; /** * Retrieves an [Order](#type-order) by ID. */ retrieveOrder(orderId: string): Promise; /** * Search all orders for one or more locations. Orders include all sales, returns, and exchanges regardless of how * or when they entered the Square Ecosystem (e.g. Point of Sale, Invoices, Connect APIs, etc). SearchOrders requests * need to specify which locations to search and define a [`SearchOrdersQuery`](#type-searchordersquery) object which * controls how to sort or filter the results. Your SearchOrdersQuery can: Set filter criteria. Set sort order. * Determine whether to return results as complete Order objects, or as [OrderEntry](#type-orderentry) objects. * Note that details for orders processed with Square Point of Sale while in offline mode may not be transmitted to * Square for up to 72 hours. Offline orders have a `created_at` value that reflects the time the order was created, * not the time it was subsequently transmitted to Square. */ searchOrders(body: SearchOrdersRequest): Promise; /** * Updates an open [Order](#type-order) by adding, replacing, or deleting fields. Orders with a `COMPLETED` or `CANCELED` * state cannot be updated. An UpdateOrder request requires the following: * - The `order_id` in the endpoint path, identifying the order to update. * - The latest `version` of the order to update. * - The [sparse order](/orders-api/manage-orders#sparse-order-objects) containing only the fields to update and the version the update is being applied to. * - If deleting fields, the [dot notation paths](/orders-api/manage-orders#on-dot-notation) identifying fields to clear. * To pay for an order, please refer to the [Pay for Orders](/orders-api/pay-for-orders) guide. * To learn more about the Orders API, see the [Orders API Overview](/orders-api/what-it-does). */ updateOrder(orderId: string, body: UpdateOrderRequest): Promise; } export class PaymentsApi { /** * Constructs a new PaymentsApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Cancels (voids) a payment. If you set `autocomplete` to false when creating a payment, you can cancel the payment * using this endpoint. For more information, see [Delayed Payments](/payments-api/take-payments#delayed-payments). */ cancelPayment(paymentId: string): Promise; /** * Cancels (voids) a payment identified by the idempotency key that is specified in the request. * Use this method when status of a CreatePayment request is unknown. For example, after you send a CreatePayment * request a network error occurs and you don't get a response. In this case, you can direct Square to cancel * the payment using this endpoint. In the request, you provide the same idempotency key that you provided in your * CreatePayment request you want to cancel. After cancelling the payment, you can submit your CreatePayment request again. * Note that if no payment with the specified idempotency key is found, no action is taken, the end point returns successfully. */ cancelPaymentByIdempotencyKey( body: CancelPaymentByIdempotencyKeyRequest, ): Promise; /** * Completes (captures) a payment. By default, payments are set to complete immediately after they are created. * If you set autocomplete to false when creating a payment, you can complete (capture) the payment using this endpoint. * For more information, see [Delayed Payments](/payments-api/take-payments#delayed-payments). */ completePayment(paymentId: string): Promise; /** * Charges a payment source, for example, a card represented by customer's card on file or a card nonce. * In addition to the payment source, the request must also include the amount to accept for the payment. * There are several optional parameters that you can include in the request. * For example, tip money, whether to autocomplete the payment, or a reference ID to correlate this payment with * another system. For more information about these payment options, see [Take Payments](/payments-api/take-payments). * The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required to enable application fees. */ createPayment(body: CreatePaymentRequest): Promise; /** * Retrieves details for a specific Payment. */ getPayment(paymentId: string): Promise; /** * Retrieves a list of payments taken by the account making the request. Max results per page: 100. */ listPayments(params: ListPaymentsRequest): Promise; } export class RefundsApi { /** * Constructs a new RefundsApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Retrieves a specific `Refund` using the `refund_id`. */ getPaymentRefund(refundId: string): Promise; /** * Retrieves a list of refunds for the account making the request. Max results per page: 100. */ listPaymentRefunds(params: ListPaymentRefundsRequest): Promise; /** * Refunds a payment. You can refund the entire payment amount or a portion of it. * For more information, see [Payments and Refunds Overview](/payments-api/overview). */ refundPayment(body: RefundPaymentRequest): Promise; } // @todo describe methods export class SubscriptionsApi {} // @todo describe methods export class ReportingApi {} // @todo describe methods export class TeamApi {} // @todo describe methods export class TerminalApi {} export class TransactionsApi { /** * Constructs a new TransactionsApi. * @param apiClient Optional API client implementation to use, default to ApiClient.instance if unspecified. */ constructor(apiClient?: ApiClient); /** * Captures a transaction that was created with the [Charge](#endpoint-transactions-charge) endpoint with a `delay_capture` value of `true`. * See the [Delay Capture of Funds](/transactions-api/cookbook/delay-capture) recipe for more information. */ captureTransaction(locationId: string, transactionId: string): Promise; /** * Charges a card represented by a card nonce or a customer's card on file. * @deprecated recommend using [CreatePayment](#endpoint-payments-createpayment) Your request to this endpoint must * include _either_: - A value for the `card_nonce` parameter (to charge a card nonce generated with the `SqPaymentForm`) * - Values for the `customer_card_id` and `customer_id` parameters (to charge a customer's card on file) When this * response is returned, the amount of Square's processing fee might not yet be calculated. To obtain the processing fee, * wait about ten seconds and call [RetrieveTransaction](#endpoint-transactions-retrievetransaction). * See the `processing_fee_money` field of each [Tender included](#type-tender) in the transaction. */ charge(locationId: string, body: ChargeRequest): Promise; /** * Initiates a refund for a previously charged tender. * @deprecated recommend using [RefundPayment](#endpoint-refunds-refundpayment) You must issue a refund within 120 * days of the associated payment. See [this article](https://squareup.com/help/us/en/article/5060) for more * information on refund behavior. * @note Card-present transactions with Interac credit cards **cannot be refunded using the Connect API**. * Interac transactions must refunded in-person (e.g., dipping the card using POS app). */ createRefund(locationId: string, transactionId: string, body: CreateRefundRequest): Promise; /** * Lists refunds for one of a business's locations. * @deprecated recommend using [SearchOrders](#endpoint-orders-searchorders) In addition to full or partial tender * refunds processed through Square APIs, refunds may result from itemized returns or exchanges through Square's * Point of Sale applications. Refunds with a `status` of `PENDING` are not currently included in this endpoint's response. * Max results per [page](#paginatingresults): 50. */ listRefunds(locationId: string, params: ListRefundsRequest): Promise; /** * Lists transactions for a particular location. * @deprecated recommend using [SearchOrders](#endpoint-orders-searchorders) Transactions include payment information * from sales and exchanges and refund information from returns and exchanges. * Max results per [page](#paginatingresults): 50. */ listTransactions(locationId: string, params: ListTransactionsRequest): Promise; /** * Retrieves details for a single transaction. * @deprecated recommend using [BatchRetrieveOrders](#endpoint-batchretrieveorders). */ retrieveTransaction(locationId: string, transactionId: string): Promise; /** * Cancels a transaction that was created with the [Charge](#endpoint-transactions-charge) endpoint with a * `delay_capture` value of `true`. See the [Delay Capture of Funds](/transactions-api/cookbook/delay-capture) recipe * for more information. */ voidTransaction(locationId: string, transactionId: string): Promise; }