From 64fb247206cd9a483d486baddc9d296db109a5da Mon Sep 17 00:00:00 2001 From: Dmitri Dimitrioglo Date: Tue, 11 Jun 2019 11:59:44 +0300 Subject: [PATCH] Update Square connect type definitions (v20190508) + improvements (#36067) * Add Square dev as a reviewer + add ApiClient, EmployeesApi and InventoryApi definitions * Update Square connect type definitions (v20190508) * Fix ENUM naming (to be as in swagger) --- types/square-connect/README.md | 23 + types/square-connect/index.d.ts | 1818 +++++++++++++++++++++++-------- 2 files changed, 1406 insertions(+), 435 deletions(-) create mode 100644 types/square-connect/README.md diff --git a/types/square-connect/README.md b/types/square-connect/README.md new file mode 100644 index 0000000000..d22a54e142 --- /dev/null +++ b/types/square-connect/README.md @@ -0,0 +1,23 @@ +# Type definitions for square-connect + +This is an unofficial package of type definitions for [square-connect][1] which is _mostly_ generated automatically by [swagger-codegen][2]. +In case you are facing some issues - feel free to contribute or open an issue. + +# Installation + +`npm i @types/square-connect` +> make sure that `square-connect` package is installed too + +# Contribution + +* Clone the [DefinitelyTyped][3] project + * or update if you already have it (`git fetch upstream && git reset --hard upstream/master`) +* Add your changes and commit them (in case of error in [api.json][4] too, let the Square team know about it) +* Test your changes: + * `npm run lint square-connect` + * `npm run test` + +[1]: https://docs.connect.squareup.com +[2]: https://github.com/swagger-api/swagger-codegen +[3]: https://github.com/DefinitelyTyped/DefinitelyTyped +[4]: https://github.com/square/connect-api-specification/blob/master/api.json diff --git a/types/square-connect/index.d.ts b/types/square-connect/index.d.ts index f36d105b15..d6a9d775f6 100644 --- a/types/square-connect/index.d.ts +++ b/types/square-connect/index.d.ts @@ -1,15 +1,10 @@ -// Type definitions for square-connect 2.20190410 +// Type definitions for square-connect 2.20190508 // Project: https://docs.connect.squareup.com/ // Definitions by: Dmitri Dimitrioglo +// Richard Moot // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -/** - * @version Square Connect API v20190410 - * @note: This class is MOSTLY generated by the swagger code generator program. - * @link https://github.com/swagger-api/swagger-codegen.git - */ - /** * Represents an additional recipient (other than the merchant) receiving a portion of this tender. */ @@ -541,23 +536,23 @@ export class BatchRetrieveInventoryChangesRequest { export namespace BatchRetrieveInventoryChangesRequest { export enum TypesEnum { - PHYSICALCOUNT = 'PHYSICAL_COUNT', + PHYSICAL_COUNT = 'PHYSICAL_COUNT', ADJUSTMENT = 'ADJUSTMENT', TRANSFER = 'TRANSFER', } export enum StatesEnum { CUSTOM = 'CUSTOM', - INSTOCK = 'IN_STOCK', + IN_STOCK = 'IN_STOCK', SOLD = 'SOLD', - RETURNEDBYCUSTOMER = 'RETURNED_BY_CUSTOMER', - RESERVEDFORSALE = 'RESERVED_FOR_SALE', - SOLDONLINE = 'SOLD_ONLINE', - ORDEREDFROMVENDOR = 'ORDERED_FROM_VENDOR', - RECEIVEDFROMVENDOR = 'RECEIVED_FROM_VENDOR', - INTRANSITTO = 'IN_TRANSIT_TO', + RETURNED_BY_CUSTOMER = 'RETURNED_BY_CUSTOMER', + RESERVED_FOR_SALE = 'RESERVED_FOR_SALE', + SOLD_ONLINE = 'SOLD_ONLINE', + ORDERED_FROM_VENDOR = 'ORDERED_FROM_VENDOR', + RECEIVED_FROM_VENDOR = 'RECEIVED_FROM_VENDOR', + IN_TRANSIT_TO = 'IN_TRANSIT_TO', NONE = 'NONE', WASTE = 'WASTE', - UNLINKEDRETURN = 'UNLINKED_RETURN', + UNLINKED_RETURN = 'UNLINKED_RETURN', } } @@ -633,6 +628,11 @@ export class BatchRetrieveOrdersResponse { * Any errors that occurred during the request. */ errors?: Array; + /** + * List of transaction ids within the requested set of ids that encountered transformation issues when being + * converted to an Order. + */ + unconvertible_transaction_ids?: Array; } export class BatchUpsertCatalogObjectsRequest { @@ -720,6 +720,46 @@ export class BreakType { updated_at?: string; } +/** + * 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?: Array; +} + +/** + * 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?: BusinessHoursPeriod.DayOfWeekEnum; + /** + * The start time of a business hours period, specified in local time using partial-time RFC3339 format. + */ + start_local_time?: string; + /** + * The end time of a business hours period, specified in local time using partial-time RFC3339 format. + */ + end_local_time?: string; +} + +export namespace BusinessHoursPeriod { + export enum DayOfWeekEnum { + SUN = 'SUN', + MON = 'MON', + TUE = 'TUE', + WED = 'WED', + THU = 'THU', + FRI = 'FRI', + SAT = 'SAT', + } +} + export class CaptureTransactionRequest {} /** @@ -775,15 +815,15 @@ export class Card { export namespace Card { export enum CardBrandEnum { - OTHERBRAND = 'OTHER_BRAND', + OTHER_BRAND = 'OTHER_BRAND', VISA = 'VISA', MASTERCARD = 'MASTERCARD', - AMERICANEXPRESS = 'AMERICAN_EXPRESS', + AMERICAN_EXPRESS = 'AMERICAN_EXPRESS', DISCOVER = 'DISCOVER', - DISCOVERDINERS = 'DISCOVER_DINERS', + DISCOVER_DINERS = 'DISCOVER_DINERS', JCB = 'JCB', - CHINAUNIONPAY = 'CHINA_UNIONPAY', - SQUAREGIFTCARD = 'SQUARE_GIFT_CARD', + CHINA_UNIONPAY = 'CHINA_UNIONPAY', + SQUARE_GIFT_CARD = 'SQUARE_GIFT_CARD', } } @@ -839,10 +879,10 @@ export class CatalogDiscount { export namespace CatalogDiscount { export enum DiscountTypeEnum { - FIXEDPERCENTAGE = 'FIXED_PERCENTAGE', - FIXEDAMOUNT = 'FIXED_AMOUNT', - VARIABLEPERCENTAGE = 'VARIABLE_PERCENTAGE', - VARIABLEAMOUNT = 'VARIABLE_AMOUNT', + FIXED_PERCENTAGE = 'FIXED_PERCENTAGE', + FIXED_AMOUNT = 'FIXED_AMOUNT', + VARIABLE_PERCENTAGE = 'VARIABLE_PERCENTAGE', + VARIABLE_AMOUNT = 'VARIABLE_AMOUNT', } } /** @@ -1020,10 +1060,10 @@ export class CatalogItem { export namespace CatalogItem { export enum ProductTypeEnum { REGULAR = 'REGULAR', - GIFTCARD = 'GIFT_CARD', - APPOINTMENTSSERVICE = 'APPOINTMENTS_SERVICE', - RETAILITEM = 'RETAIL_ITEM', - RESTAURANTITEM = 'RESTAURANT_ITEM', + GIFT_CARD = 'GIFT_CARD', + APPOINTMENTS_SERVICE = 'APPOINTMENTS_SERVICE', + RETAIL_ITEM = 'RETAIL_ITEM', + RESTAURANT_ITEM = 'RESTAURANT_ITEM', } } @@ -1131,12 +1171,12 @@ export class CatalogItemVariation { export namespace CatalogItemVariation { export enum PricingTypeEnum { - FIXEDPRICING = 'FIXED_PRICING', - VARIABLEPRICING = 'VARIABLE_PRICING', + FIXED_PRICING = 'FIXED_PRICING', + VARIABLE_PRICING = 'VARIABLE_PRICING', } export enum InventoryAlertTypeEnum { NONE = 'NONE', - LOWQUANTITY = 'LOW_QUANTITY', + LOW_QUANTITY = 'LOW_QUANTITY', } } @@ -1209,12 +1249,13 @@ export class CatalogModifierOverride { * The wrapper object for object types in the Catalog data model. * The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. * - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - * - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid object. - * - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid object. - * - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid object. - * - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid object. - * - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid object. + * - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. + * - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. + * - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. + * - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. + * - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. * - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. + * - if type = `IMAGE`, only `image_data` will be populated and it will contain a valid [CatalogImage](#type-catalogimage) object. * For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview). */ export class CatalogObject { @@ -1236,8 +1277,8 @@ export class CatalogObject { */ updated_at?: string; /** - * The version of the object. When updating an object, the version supplied by the must match the version in the - * database, otherwise the write will be rejected as conflicting. + * 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; /** @@ -1308,10 +1349,10 @@ export namespace CatalogObject { ITEM = 'ITEM', IMAGE = 'IMAGE', CATEGORY = 'CATEGORY', - ITEMVARIATION = 'ITEM_VARIATION', + ITEM_VARIATION = 'ITEM_VARIATION', TAX = 'TAX', DISCOUNT = 'DISCOUNT', - MODIFIERLIST = 'MODIFIER_LIST', + MODIFIER_LIST = 'MODIFIER_LIST', MODIFIER = 'MODIFIER', } } @@ -1339,14 +1380,18 @@ export class CatalogObjectType {} export class CatalogPricingType {} /** - * A query to be applied to a SearchCatalogObjects request. Only one query field may be present. Where an attribute - * name is required, it should be specified as the name of any field marked \"searchable\" from the structured data - * types for the desired result object type(s) ([CatalogItem](#type-catalogitem), - * [CatalogItemVariation](#type-catalogitemvariation), [CatalogCategory](#type-catalogcategory), - * [CatalogTax](#type-catalogtax), [CatalogDiscount](#type-catalogdiscount), - * [CatalogModifierList](#type-catalogmodifierlist), [CatalogModifier](#type-catalogmodifier)). For example, a query - * that should return Items may specify attribute names from any of the searchable fields of the - * [CatalogItem](#type-catalogitem) data type, namely `\"name\"`, `\"description\"`, and `\"abbreviation\"`. + * A query to be applied to a [SearchCatalogObjectsRequest](#type-searchcatalogobjectsrequest). Only one query field may be present. + * Where an attribute name is required, it should be specified as the name of any field marked "searchable" from the structured + * data types for the desired result object type(s): + * [CatalogItem](#type-catalogitem), + * [CatalogItemVariation](#type-catalogitemvariation), + * [CatalogCategory](#type-catalogcategory), + * [CatalogTax](#type-catalogtax), + * [CatalogDiscount](#type-catalogdiscount), + * [CatalogModifierList](#type-catalogmodifierlist), + * [CatalogModifier](#type-catalogmodifier) + * For example, a query that should return Items may specify attribute names from any of the searchable fields of + * the [CatalogItem](#type-catalogitem) data type, namely "name", "description", and "abbreviation". */ export class CatalogQuery { /** @@ -1504,8 +1549,8 @@ export class CatalogTax { export namespace CatalogTax { export enum CalculationPhaseEnum { - SUBTOTALPHASE = 'TAX_SUBTOTAL_PHASE', - TOTALPHASE = 'TAX_TOTAL_PHASE', + TAX_SUBTOTAL_PHASE = 'TAX_SUBTOTAL_PHASE', + TAX_TOTAL_PHASE = 'TAX_TOTAL_PHASE', } export enum InclusionTypeEnum { ADDITIVE = 'ADDITIVE', @@ -1567,6 +1612,9 @@ export class ChargeRequest { */ reference_id?: string; + /** + * An optional note to associate with the transaction. This value cannot exceed 60 characters. + */ note?: string; /** * The ID of the customer to associate this transaction with. @@ -1574,18 +1622,15 @@ export class ChargeRequest { */ customer_id?: string; /** - * 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. + * The buyer's billing address. */ billing_address?: Address; /** - * 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. + * The buyer's shipping address, if available. */ shipping_address?: Address; /** - * The buyer's email address, if available. This value is optional, but this transaction is ineligible for - * chargeback protection if it is not provided. + * The buyer's email address, if available. */ buyer_email_address?: string; /** @@ -1953,9 +1998,10 @@ export class CreateOrderRequest { */ idempotency_key?: string; /** - * @deprecated Please set the reference_id on the nested [order](#type-order) field instead. An optional ID you - * can associate with the order for your own purposes (such as to associate the order with an entity ID in your own - * database). This value cannot exceed 40 characters. + * @deprecated Please set the reference_id on the nested [order](#type-order) field instead. An optional ID you can + * associate with the order for your own purposes (such as to associate the order with an entity ID in your own database). + * This value cannot exceed 40 characters. + * -- Top-level fields necessary to support the connect v2 CreateOrderRequest shape. */ reference_id?: string; /** @@ -2078,8 +2124,8 @@ export class CreateOrderRequestModifier { /** * @deprecated Please use the [OrderLineItemTax](#type-orderlineitemtax) type in the order field of - * [CreateOrderRequest](#type-createorderrequest) instead. Represents a tax that can apply to either a single line item - * or an entire order. + * [CreateOrderRequest](#type-createorderrequest) instead. + * Represents a tax that can apply to either a single line item or an entire order. */ export class CreateOrderRequestTax { /** @@ -2094,6 +2140,7 @@ export class CreateOrderRequestTax { /** * Only used for ad hoc taxes. Indicates the calculation method used to apply the line item tax. * Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + * See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. */ type?: CreateOrderRequestTax.TypeEnum; /** @@ -2105,7 +2152,7 @@ export class CreateOrderRequestTax { export namespace CreateOrderRequestTax { export enum TypeEnum { - UNKNOWNTAX = 'UNKNOWN_TAX', + UNKNOWN_TAX = 'UNKNOWN_TAX', ADDITIVE = 'ADDITIVE', INCLUSIVE = 'INCLUSIVE', } @@ -2286,22 +2333,22 @@ export namespace Customer { OTHER = 'OTHER', APPOINTMENTS = 'APPOINTMENTS', COUPON = 'COUPON', - DELETIONRECOVERY = 'DELETION_RECOVERY', + DELETION_RECOVERY = 'DELETION_RECOVERY', DIRECTORY = 'DIRECTORY', EGIFTING = 'EGIFTING', - EMAILCOLLECTION = 'EMAIL_COLLECTION', + EMAIL_COLLECTION = 'EMAIL_COLLECTION', FEEDBACK = 'FEEDBACK', IMPORT = 'IMPORT', INVOICES = 'INVOICES', LOYALTY = 'LOYALTY', MARKETING = 'MARKETING', MERGE = 'MERGE', - ONLINESTORE = 'ONLINE_STORE', - INSTANTPROFILE = 'INSTANT_PROFILE', + ONLINE_STORE = 'ONLINE_STORE', + INSTANT_PROFILE = 'INSTANT_PROFILE', TERMINAL = 'TERMINAL', THIRDPARTY = 'THIRD_PARTY', - THIRDPARTYIMPORT = 'THIRD_PARTY_IMPORT', - UNMERGERECOVERY = 'UNMERGE_RECOVERY', + THIRD_PARTY_IMPORT = 'THIRD_PARTY_IMPORT', + UNMERGE_RECOVERY = 'UNMERGE_RECOVERY', } } @@ -2333,22 +2380,22 @@ export namespace CustomerCreationSourceFilter { OTHER = 'OTHER', APPOINTMENTS = 'APPOINTMENTS', COUPON = 'COUPON', - DELETIONRECOVERY = 'DELETION_RECOVERY', + DELETION_RECOVERY = 'DELETION_RECOVERY', DIRECTORY = 'DIRECTORY', EGIFTING = 'EGIFTING', - EMAILCOLLECTION = 'EMAIL_COLLECTION', + EMAIL_COLLECTION = 'EMAIL_COLLECTION', FEEDBACK = 'FEEDBACK', IMPORT = 'IMPORT', INVOICES = 'INVOICES', LOYALTY = 'LOYALTY', MARKETING = 'MARKETING', MERGE = 'MERGE', - ONLINESTORE = 'ONLINE_STORE', - INSTANTPROFILE = 'INSTANT_PROFILE', + ONLINE_STORE = 'ONLINE_STORE', + INSTANT_PROFILE = 'INSTANT_PROFILE', TERMINAL = 'TERMINAL', - THIRDPARTY = 'THIRD_PARTY', - THIRDPARTYIMPORT = 'THIRD_PARTY_IMPORT', - UNMERGERECOVERY = 'UNMERGE_RECOVERY', + THIRD_PARTY = 'THIRD_PARTY', + THIRD_PARTY_IMPORT = 'THIRD_PARTY_IMPORT', + UNMERGE_RECOVERY = 'UNMERGE_RECOVERY', } export enum RuleEnum { INCLUDE = 'INCLUDE', @@ -2440,7 +2487,7 @@ export class CustomerSort { export namespace CustomerSort { export enum FieldEnum { DEFAULT = 'DEFAULT', - CREATEDAT = 'CREATED_AT', + CREATED_AT = 'CREATED_AT', } export enum OrderEnum { DESC = 'DESC', @@ -2469,6 +2516,11 @@ export class DateRange { end_date?: string; } +/** + * Indicates the specific day of the week. + */ +export class DayOfWeek {} + /** * A request to delete a `BreakType` */ @@ -2576,6 +2628,14 @@ export class Employee { * Family (last) name of the employee */ last_name?: string; + /** + * Email of the employee + */ + email?: string; + /** + * Phone number of the employee in E.164 format, i.e. "+12125554250" + */ + phone_number?: string; /** * A list of location IDs where this employee has access. */ @@ -2736,7 +2796,11 @@ export class InventoryAdjustment { */ catalog_object_type?: string; /** - * The number of items affected by the adjustment as a decimal string. Fractional quantities are not supported. + * The number of items affected by the adjustment as a decimal string. Can support up to 5 digits after the decimal point. + * @important: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app + * or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down + * to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. + * Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information. */ quantity?: string; /** @@ -2786,31 +2850,31 @@ export class InventoryAdjustment { export namespace InventoryAdjustment { export enum FromStateEnum { CUSTOM = 'CUSTOM', - INSTOCK = 'IN_STOCK', + IN_STOCK = 'IN_STOCK', SOLD = 'SOLD', - RETURNEDBYCUSTOMER = 'RETURNED_BY_CUSTOMER', - RESERVEDFORSALE = 'RESERVED_FOR_SALE', - SOLDONLINE = 'SOLD_ONLINE', - ORDEREDFROMVENDOR = 'ORDERED_FROM_VENDOR', - RECEIVEDFROMVENDOR = 'RECEIVED_FROM_VENDOR', - INTRANSITTO = 'IN_TRANSIT_TO', + RETURNED_BY_CUSTOMER = 'RETURNED_BY_CUSTOMER', + RESERVED_FOR_SALE = 'RESERVED_FOR_SALE', + SOLD_ONLINE = 'SOLD_ONLINE', + ORDERED_FROM_VENDOR = 'ORDERED_FROM_VENDOR', + RECEIVED_FROM_VENDOR = 'RECEIVED_FROM_VENDOR', + IN_TRANSIT_TO = 'IN_TRANSIT_TO', NONE = 'NONE', WASTE = 'WASTE', - UNLINKEDRETURN = 'UNLINKED_RETURN', + UNLINKED_RETURN = 'UNLINKED_RETURN', } export enum ToStateEnum { CUSTOM = 'CUSTOM', - INSTOCK = 'IN_STOCK', + IN_STOCK = 'IN_STOCK', SOLD = 'SOLD', - RETURNEDBYCUSTOMER = 'RETURNED_BY_CUSTOMER', - RESERVEDFORSALE = 'RESERVED_FOR_SALE', - SOLDONLINE = 'SOLD_ONLINE', - ORDEREDFROMVENDOR = 'ORDERED_FROM_VENDOR', - RECEIVEDFROMVENDOR = 'RECEIVED_FROM_VENDOR', - INTRANSITTO = 'IN_TRANSIT_TO', + RETURNED_BY_CUSTOMER = 'RETURNED_BY_CUSTOMER', + RESERVED_FOR_SALE = 'RESERVED_FOR_SALE', + SOLD_ONLINE = 'SOLD_ONLINE', + ORDERED_FROM_VENDOR = 'ORDERED_FROM_VENDOR', + RECEIVED_FROM_VENDOR = 'RECEIVED_FROM_VENDOR', + IN_TRANSIT_TO = 'IN_TRANSIT_TO', NONE = 'NONE', WASTE = 'WASTE', - UNLINKEDRETURN = 'UNLINKED_RETURN', + UNLINKED_RETURN = 'UNLINKED_RETURN', } } @@ -2846,7 +2910,7 @@ export class InventoryChange { export namespace InventoryChange { export enum TypeEnum { - PHYSICALCOUNT = 'PHYSICAL_COUNT', + PHYSICAL_COUNT = 'PHYSICAL_COUNT', ADJUSTMENT = 'ADJUSTMENT', TRANSFER = 'TRANSFER', } @@ -2858,7 +2922,7 @@ export namespace InventoryChange { export class InventoryChangeType {} /** - * Represents the estimated quantity of items in a particular state at a particular location based on the known history + * 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 { @@ -2881,7 +2945,11 @@ export class InventoryCount { */ location_id?: string; /** - * The number of items in the count as a decimal string. Fractional quantities are not supported. + * The number of items in the count as a decimal string. Can support up to 5 digits after the decimal point. + * @important The Point of Sale app and Dashboard do not currently support decimal quantities. + * If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, + * the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. + * Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information. */ quantity?: string; /** @@ -2894,23 +2962,24 @@ export class InventoryCount { export namespace InventoryCount { export enum StateEnum { CUSTOM = 'CUSTOM', - INSTOCK = 'IN_STOCK', + IN_STOCK = 'IN_STOCK', SOLD = 'SOLD', - RETURNEDBYCUSTOMER = 'RETURNED_BY_CUSTOMER', - RESERVEDFORSALE = 'RESERVED_FOR_SALE', - SOLDONLINE = 'SOLD_ONLINE', - ORDEREDFROMVENDOR = 'ORDERED_FROM_VENDOR', - RECEIVEDFROMVENDOR = 'RECEIVED_FROM_VENDOR', - INTRANSITTO = 'IN_TRANSIT_TO', + RETURNED_BY_CUSTOMER = 'RETURNED_BY_CUSTOMER', + RESERVED_FOR_SALE = 'RESERVED_FOR_SALE', + SOLD_ONLINE = 'SOLD_ONLINE', + ORDERED_FROM_VENDOR = 'ORDERED_FROM_VENDOR', + RECEIVED_FROM_VENDOR = 'RECEIVED_FROM_VENDOR', + IN_TRANSIT_TO = 'IN_TRANSIT_TO', NONE = 'NONE', WASTE = 'WASTE', - UNLINKEDRETURN = 'UNLINKED_RETURN', + UNLINKED_RETURN = 'UNLINKED_RETURN', } } /** - * Represents a verified (re)count of items in a given state at a specific location. - * For example, the quantity of items currently on hand at a physical store). + * 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 { /** @@ -2941,7 +3010,11 @@ export class InventoryPhysicalCount { */ location_id?: string; /** - * The number of items affected by the physical count as a decimal string. Fractional quantities are not supported. + * The number of items affected by the physical count as a decimal string. Can support up to 5 digits after the decimal point. + * @important The Point of Sale app and Dashboard do not currently support decimal quantities. + * If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, + * the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. + * Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information. */ quantity?: string; /** @@ -2966,17 +3039,17 @@ export class InventoryPhysicalCount { export namespace InventoryPhysicalCount { export enum StateEnum { CUSTOM = 'CUSTOM', - INSTOCK = 'IN_STOCK', + IN_STOCK = 'IN_STOCK', SOLD = 'SOLD', - RETURNEDBYCUSTOMER = 'RETURNED_BY_CUSTOMER', - RESERVEDFORSALE = 'RESERVED_FOR_SALE', - SOLDONLINE = 'SOLD_ONLINE', - ORDEREDFROMVENDOR = 'ORDERED_FROM_VENDOR', - RECEIVEDFROMVENDOR = 'RECEIVED_FROM_VENDOR', - INTRANSITTO = 'IN_TRANSIT_TO', + RETURNED_BY_CUSTOMER = 'RETURNED_BY_CUSTOMER', + RESERVED_FOR_SALE = 'RESERVED_FOR_SALE', + SOLD_ONLINE = 'SOLD_ONLINE', + ORDERED_FROM_VENDOR = 'ORDERED_FROM_VENDOR', + RECEIVED_FROM_VENDOR = 'RECEIVED_FROM_VENDOR', + IN_TRANSIT_TO = 'IN_TRANSIT_TO', NONE = 'NONE', WASTE = 'WASTE', - UNLINKEDRETURN = 'UNLINKED_RETURN', + UNLINKED_RETURN = 'UNLINKED_RETURN', } } @@ -3015,12 +3088,16 @@ export class InventoryTransfer { */ catalog_object_id?: string; /** - * The [CatalogObjectType](#type-catalogobjecttype) of the [CatalogObject](#type-catalogobject) being - * tracked.Tracking is only supported for the `ITEM_VARIATION` type. + * The [CatalogObjectType](#type-catalogobjecttype) of the [CatalogObject](#type-catalogobject) being tracked. + * Tracking is only supported for the `ITEM_VARIATION` type. */ catalog_object_type?: string; /** - * The number of items affected by the transfer as a decimal string. Fractional quantities are not supported. + * The number of items affected by the transfer as a decimal string. Can support up to 5 digits after the decimal point. + * @important The Point of Sale app and Dashboard do not currently support decimal quantities. + * If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, + * the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. + * Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information. */ quantity?: string; /** @@ -3045,17 +3122,17 @@ export class InventoryTransfer { export namespace InventoryTransfer { export enum StateEnum { CUSTOM = 'CUSTOM', - INSTOCK = 'IN_STOCK', + IN_STOCK = 'IN_STOCK', SOLD = 'SOLD', - RETURNEDBYCUSTOMER = 'RETURNED_BY_CUSTOMER', - RESERVEDFORSALE = 'RESERVED_FOR_SALE', - SOLDONLINE = 'SOLD_ONLINE', - ORDEREDFROMVENDOR = 'ORDERED_FROM_VENDOR', - RECEIVEDFROMVENDOR = 'RECEIVED_FROM_VENDOR', - INTRANSITTO = 'IN_TRANSIT_TO', + RETURNED_BY_CUSTOMER = 'RETURNED_BY_CUSTOMER', + RESERVED_FOR_SALE = 'RESERVED_FOR_SALE', + SOLD_ONLINE = 'SOLD_ONLINE', + ORDERED_FROM_VENDOR = 'ORDERED_FROM_VENDOR', + RECEIVED_FROM_VENDOR = 'RECEIVED_FROM_VENDOR', + IN_TRANSIT_TO = 'IN_TRANSIT_TO', NONE = 'NONE', WASTE = 'WASTE', - UNLINKEDRETURN = 'UNLINKED_RETURN', + UNLINKED_RETURN = 'UNLINKED_RETURN', } } @@ -3098,12 +3175,12 @@ export class ItemVariationLocationOverrides { export namespace ItemVariationLocationOverrides { export enum PricingTypeEnum { - FIXEDPRICING = 'FIXED_PRICING', - VARIABLEPRICING = 'VARIABLE_PRICING', + FIXED_PRICING = 'FIXED_PRICING', + VARIABLE_PRICING = 'VARIABLE_PRICING', } export enum InventoryAlertTypeEnum { NONE = 'NONE', - LOWQUANTITY = 'LOW_QUANTITY', + LOW_QUANTITY = 'LOW_QUANTITY', } } @@ -3258,9 +3335,9 @@ export class ListCatalogRequest { */ cursor?: string; /** - * An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. - * The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely "ITEM", - * "ITEM_VARIATION", "CATEGORY", "DISCOUNT", "TAX", "MODIFIER" or "MODIFIER_LIST". + * An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. + * The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely: + * `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. */ types?: string; } @@ -3305,7 +3382,7 @@ export class ListCustomersRequest { export namespace ListCustomersRequest { export enum SortFieldEnum { DEFAULT = 'DEFAULT', - CREATEDAT = 'CREATED_AT', + CREATED_AT = 'CREATED_AT', } export enum SortOrderEnum { DESC = 'DESC', @@ -3589,8 +3666,7 @@ export class Location { */ id?: string; /** - * The location's name. Location names are set by the account owner and displayed in the dashboard as the location's - * nickname + * The location's name. Location names are set by the account owner and displayed in the dashboard as the location's nickname. */ name?: string; /** @@ -3602,12 +3678,12 @@ export class Location { */ timezone?: string; /** - * Indicates which Square features are enabled for the location. See [LocationCapability](#type-locationcapability) - * for possible values. + * Indicates which Square features are enabled for the location. + * See [LocationCapability](#type-locationcapability) for possible values. */ capabilities?: Array; /** - * The location's status See [LocationStatus](#type-locationstatus) for possible values. + * The location's status. See [LocationStatus](#type-locationstatus) for possible values. */ status?: Location.StatusEnum; /** @@ -3627,9 +3703,9 @@ export class Location { */ language_code?: string; /** - * The currency used for all transactions at this location, specified in __ISO 4217 format__. For example, the - * currency for a location processing transactions in the United States is 'USD'. See [Currency](#type-currency) - * for possible values. + * The currency used for all transactions at this location, specified in __ISO 4217 format__. + * For example, the currency for a location processing transactions in the United States is 'USD'. + * See [Currency](#type-currency) for possible values. */ currency?: Location.CurrencyEnum; /** @@ -3637,26 +3713,30 @@ export class Location { */ phone_number?: string; /** - * The location's business_name which is shown to its customers. For example, this is the name printed on its - * customer's receipts. + * The location's business_name which is shown to its customers. + * For example, this is the name printed on its customer's receipts. */ business_name?: string; /** - * The location's type, as set by the account owner in the Square dashboard. Typically used to indicate whether or - * not the location object represents a physical space like a building or mall space. See - * [LocationType](#type-locationtype) for possible values. + * The location's type, as set by the account owner in the Square dashboard. + * Typically used to indicate whether or not the location object represents a physical space like a building or mall space. + * See [LocationType](#type-locationtype) for possible values. */ type?: Location.TypeEnum; /** - * The location's website, as set by the account owner in the Square dashboard. Default: none; only exists if - * explicitly set. + * The location's website, as set by the account owner in the Square dashboard. + * Default: none; only exists if explicitly set. */ website_url?: string; + /** + * The hours of operation for a business location. Default: none; only exists if explicitly set. + */ + business_hours?: BusinessHours; } export namespace Location { export enum CapabilitiesEnum { - CREDITCARDPROCESSING = 'CREDIT_CARD_PROCESSING', + CREDIT_CARD_PROCESSING = 'CREDIT_CARD_PROCESSING', } export enum StatusEnum { ACTIVE = 'ACTIVE', @@ -3915,7 +3995,7 @@ export namespace Location { ZW = 'ZW', } export enum CurrencyEnum { - UNKNOWNCURRENCY = 'UNKNOWN_CURRENCY', + UNKNOWN_CURRENCY = 'UNKNOWN_CURRENCY', AED = 'AED', AFN = 'AFN', ALL = 'ALL', @@ -4118,12 +4198,119 @@ export class LocationStatus {} */ export class LocationType {} +/** + * 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`. + * The `family` field describes the type of measurement. For example, ounces are in the weight family. + */ +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; + /** + * Represents a standard area unit. See [MeasurementUnitArea](#type-measurementunitarea) for possible values. + */ + area_unit?: MeasurementUnit.AreaUnitEnum; + /** + * Represents a standard length unit. See [MeasurementUnitLength](#type-measurementunitlength) for possible values. + */ + length_unit?: MeasurementUnit.LengthUnitEnum; + /** + * Represents a standard volume unit. See [MeasurementUnitVolume](#type-measurementunitvolume) for possible values. + */ + volume_unit?: MeasurementUnit.VolumeUnitEnum; + /** + * Represents a standard unit of weight or mass. See [MeasurementUnitWeight](#type-measurementunitweight) for possible values. + */ + weight_unit?: MeasurementUnit.WeightUnitEnum; +} + +export namespace MeasurementUnit { + export enum AreaUnitEnum { + IMPERIAL_ACRE = 'IMPERIAL_ACRE', + IMPERIAL_SQUARE_INCH = 'IMPERIAL_SQUARE_INCH', + IMPERIAL_SQUARE_FOOT = 'IMPERIAL_SQUARE_FOOT', + IMPERIAL_SQUARE_YARD = 'IMPERIAL_SQUARE_YARD', + IMPERIAL_SQUARE_MILE = 'IMPERIAL_SQUARE_MILE', + METRIC_SQUARE_CENTIMETER = 'METRIC_SQUARE_CENTIMETER', + METRIC_SQUARE_METER = 'METRIC_SQUARE_METER', + METRIC_SQUARE_KILOMETER = 'METRIC_SQUARE_KILOMETER', + } + export enum LengthUnitEnum { + IMPERIAL_INCH = 'IMPERIAL_INCH', + IMPERIAL_FOOT = 'IMPERIAL_FOOT', + IMPERIAL_YARD = 'IMPERIAL_YARD', + IMPERIAL_MILE = 'IMPERIAL_MILE', + METRIC_MILLIMETER = 'METRIC_MILLIMETER', + METRIC_CENTIMETER = 'METRIC_CENTIMETER', + METRIC_METER = 'METRIC_METER', + METRIC_KILOMETER = 'METRIC_KILOMETER', + } + export enum VolumeUnitEnum { + GENERIC_FLUID_OUNCE = 'GENERIC_FLUID_OUNCE', + GENERIC_SHOT = 'GENERIC_SHOT', + GENERIC_CUP = 'GENERIC_CUP', + GENERIC_PINT = 'GENERIC_PINT', + GENERIC_QUART = 'GENERIC_QUART', + GENERIC_GALLON = 'GENERIC_GALLON', + IMPERIAL_CUBIC_INCH = 'IMPERIAL_CUBIC_INCH', + IMPERIAL_CUBIC_FOOT = 'IMPERIAL_CUBIC_FOOT', + IMPERIAL_CUBIC_YARD = 'IMPERIAL_CUBIC_YARD', + METRIC_MILLILITER = 'METRIC_MILLILITER', + METRIC_LITER = 'METRIC_LITER', + } + export enum WeightUnitEnum { + IMPERIAL_WEIGHT_OUNCE = 'IMPERIAL_WEIGHT_OUNCE', + IMPERIAL_POUND = 'IMPERIAL_POUND', + IMPERIAL_STONE = 'IMPERIAL_STONE', + METRIC_MILLIGRAM = 'METRIC_MILLIGRAM', + METRIC_GRAM = 'METRIC_GRAM', + METRIC_KILOGRAM = 'METRIC_KILOGRAM', + } +} + +/** + * 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; +} + +/** + * The unit of length used to measure a quantity. + */ +export class MeasurementUnitLength {} + +/** + * The unit of volume used to measure a quantity. + */ +export class MeasurementUnitVolume {} + +/** + * Unit of weight used to measure a quantity. + */ +export class MeasurementUnitWeight {} + /** * A record of an employee's break during a shift. */ export class ModelBreak { /** - * UUID for this object + * UUID for this object. */ id?: string; /** @@ -4178,103 +4365,105 @@ export class ModelError { export namespace ModelError { export enum CategoryEnum { - APIERROR = 'API_ERROR', - AUTHENTICATIONERROR = 'AUTHENTICATION_ERROR', - INVALIDREQUESTERROR = 'INVALID_REQUEST_ERROR', - RATELIMITERROR = 'RATE_LIMIT_ERROR', - PAYMENTMETHODERROR = 'PAYMENT_METHOD_ERROR', - REFUNDERROR = 'REFUND_ERROR', + API_ERROR = 'API_ERROR', + AUTHENTICATION_ERROR = 'AUTHENTICATION_ERROR', + INVALID_REQUEST_ERROR = 'INVALID_REQUEST_ERROR', + RATE_LIMIT_ERROR = 'RATE_LIMIT_ERROR', + PAYMENT_METHOD_ERROR = 'PAYMENT_METHOD_ERROR', + REFUND_ERROR = 'REFUND_ERROR', } export enum CodeEnum { - INTERNALSERVERERROR = 'INTERNAL_SERVER_ERROR', + INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR', UNAUTHORIZED = 'UNAUTHORIZED', - ACCESSTOKENEXPIRED = 'ACCESS_TOKEN_EXPIRED', - ACCESSTOKENREVOKED = 'ACCESS_TOKEN_REVOKED', + ACCESS_TOKEN_EXPIRED = 'ACCESS_TOKEN_EXPIRED', + ACCESS_TOKEN_REVOKED = 'ACCESS_TOKEN_REVOKED', FORBIDDEN = 'FORBIDDEN', - INSUFFICIENTSCOPES = 'INSUFFICIENT_SCOPES', - APPLICATIONDISABLED = 'APPLICATION_DISABLED', - V1APPLICATION = 'V1_APPLICATION', - V1ACCESSTOKEN = 'V1_ACCESS_TOKEN', - CARDPROCESSINGNOTENABLED = 'CARD_PROCESSING_NOT_ENABLED', - BADREQUEST = 'BAD_REQUEST', - MISSINGREQUIREDPARAMETER = 'MISSING_REQUIRED_PARAMETER', - INCORRECTTYPE = 'INCORRECT_TYPE', - INVALIDTIME = 'INVALID_TIME', - INVALIDTIMERANGE = 'INVALID_TIME_RANGE', - INVALIDVALUE = 'INVALID_VALUE', - INVALIDCURSOR = 'INVALID_CURSOR', - UNKNOWNQUERYPARAMETER = 'UNKNOWN_QUERY_PARAMETER', - CONFLICTINGPARAMETERS = 'CONFLICTING_PARAMETERS', - EXPECTEDJSONBODY = 'EXPECTED_JSON_BODY', - INVALIDSORTORDER = 'INVALID_SORT_ORDER', - VALUEREGEXMISMATCH = 'VALUE_REGEX_MISMATCH', - VALUETOOSHORT = 'VALUE_TOO_SHORT', - VALUETOOLONG = 'VALUE_TOO_LONG', - VALUETOOLOW = 'VALUE_TOO_LOW', - VALUETOOHIGH = 'VALUE_TOO_HIGH', - VALUEEMPTY = 'VALUE_EMPTY', - ARRAYLENGTHTOOLONG = 'ARRAY_LENGTH_TOO_LONG', - ARRAYLENGTHTOOSHORT = 'ARRAY_LENGTH_TOO_SHORT', - ARRAYEMPTY = 'ARRAY_EMPTY', - EXPECTEDBOOLEAN = 'EXPECTED_BOOLEAN', - EXPECTEDINTEGER = 'EXPECTED_INTEGER', - EXPECTEDFLOAT = 'EXPECTED_FLOAT', - EXPECTEDSTRING = 'EXPECTED_STRING', - EXPECTEDOBJECT = 'EXPECTED_OBJECT', - EXPECTEDARRAY = 'EXPECTED_ARRAY', - EXPECTEDMAP = 'EXPECTED_MAP', - EXPECTEDBASE64ENCODEDBYTEARRAY = 'EXPECTED_BASE64_ENCODED_BYTE_ARRAY', - INVALIDARRAYVALUE = 'INVALID_ARRAY_VALUE', - INVALIDENUMVALUE = 'INVALID_ENUM_VALUE', - INVALIDCONTENTTYPE = 'INVALID_CONTENT_TYPE', - INVALIDFORMVALUE = 'INVALID_FORM_VALUE', - ONEINSTRUMENTEXPECTED = 'ONE_INSTRUMENT_EXPECTED', - NOFIELDSSET = 'NO_FIELDS_SET', - DEPRECATEDFIELDSET = 'DEPRECATED_FIELD_SET', - CARDEXPIRED = 'CARD_EXPIRED', - INVALIDEXPIRATION = 'INVALID_EXPIRATION', - INVALIDEXPIRATIONYEAR = 'INVALID_EXPIRATION_YEAR', - INVALIDEXPIRATIONDATE = 'INVALID_EXPIRATION_DATE', - UNSUPPORTEDCARDBRAND = 'UNSUPPORTED_CARD_BRAND', - UNSUPPORTEDENTRYMETHOD = 'UNSUPPORTED_ENTRY_METHOD', - INVALIDENCRYPTEDCARD = 'INVALID_ENCRYPTED_CARD', - INVALIDCARD = 'INVALID_CARD', - DELAYEDTRANSACTIONEXPIRED = 'DELAYED_TRANSACTION_EXPIRED', - DELAYEDTRANSACTIONCANCELED = 'DELAYED_TRANSACTION_CANCELED', - DELAYEDTRANSACTIONCAPTURED = 'DELAYED_TRANSACTION_CAPTURED', - DELAYEDTRANSACTIONFAILED = 'DELAYED_TRANSACTION_FAILED', - CARDTOKENEXPIRED = 'CARD_TOKEN_EXPIRED', - CARDTOKENUSED = 'CARD_TOKEN_USED', - AMOUNTTOOHIGH = 'AMOUNT_TOO_HIGH', - UNSUPPORTEDINSTRUMENTTYPE = 'UNSUPPORTED_INSTRUMENT_TYPE', - REFUNDAMOUNTINVALID = 'REFUND_AMOUNT_INVALID', - REFUNDALREADYPENDING = 'REFUND_ALREADY_PENDING', - PAYMENTNOTREFUNDABLE = 'PAYMENT_NOT_REFUNDABLE', - INVALIDCARDDATA = 'INVALID_CARD_DATA', - LOCATIONMISMATCH = 'LOCATION_MISMATCH', - IDEMPOTENCYKEYREUSED = 'IDEMPOTENCY_KEY_REUSED', - UNEXPECTEDVALUE = 'UNEXPECTED_VALUE', - SANDBOXNOTSUPPORTED = 'SANDBOX_NOT_SUPPORTED', - INVALIDEMAILADDRESS = 'INVALID_EMAIL_ADDRESS', - INVALIDPHONENUMBER = 'INVALID_PHONE_NUMBER', - CHECKOUTEXPIRED = 'CHECKOUT_EXPIRED', - BADCERTIFICATE = 'BAD_CERTIFICATE', - CARDDECLINED = 'CARD_DECLINED', - VERIFYCVVFAILURE = 'VERIFY_CVV_FAILURE', - VERIFYAVSFAILURE = 'VERIFY_AVS_FAILURE', - CARDDECLINEDCALLISSUER = 'CARD_DECLINED_CALL_ISSUER', - NOTFOUND = 'NOT_FOUND', - APPLEPAYMENTPROCESSINGCERTIFICATEHASHNOTFOUND = 'APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND', - METHODNOTALLOWED = 'METHOD_NOT_ALLOWED', - NOTACCEPTABLE = 'NOT_ACCEPTABLE', - REQUESTTIMEOUT = 'REQUEST_TIMEOUT', + INSUFFICIENT_SCOPES = 'INSUFFICIENT_SCOPES', + APPLICATION_DISABLED = 'APPLICATION_DISABLED', + V1_APPLICATION = 'V1_APPLICATION', + V1_ACCESS_TOKEN = 'V1_ACCESS_TOKEN', + CARD_PROCESSING_NOT_ENABLED = 'CARD_PROCESSING_NOT_ENABLED', + BAD_REQUEST = 'BAD_REQUEST', + MISSING_REQUIRED_PARAMETER = 'MISSING_REQUIRED_PARAMETER', + INCORRECT_TYPE = 'INCORRECT_TYPE', + INVALID_TIME = 'INVALID_TIME', + INVALID_TIME_RANGE = 'INVALID_TIME_RANGE', + INVALID_VALUE = 'INVALID_VALUE', + INVALID_CURSOR = 'INVALID_CURSOR', + UNKNOWN_QUERY_PARAMETER = 'UNKNOWN_QUERY_PARAMETER', + CONFLICTING_PARAMETERS = 'CONFLICTING_PARAMETERS', + EXPECTED_JSON_BODY = 'EXPECTED_JSON_BODY', + INVALID_SORT_ORDER = 'INVALID_SORT_ORDER', + VALUE_REGEX_MISMATCH = 'VALUE_REGEX_MISMATCH', + VALUE_TOO_SHORT = 'VALUE_TOO_SHORT', + VALUE_TOO_LONG = 'VALUE_TOO_LONG', + VALUE_TOO_LOW = 'VALUE_TOO_LOW', + VALUE_TOO_HIGH = 'VALUE_TOO_HIGH', + VALUE_EMPTY = 'VALUE_EMPTY', + ARRAY_LENGTH_TOO_LONG = 'ARRAY_LENGTH_TOO_LONG', + ARRAY_LENGTH_TOO_SHORT = 'ARRAY_LENGTH_TOO_SHORT', + ARRAY_EMPTY = 'ARRAY_EMPTY', + EXPECTED_BOOLEAN = 'EXPECTED_BOOLEAN', + EXPECTED_INTEGER = 'EXPECTED_INTEGER', + EXPECTED_FLOAT = 'EXPECTED_FLOAT', + EXPECTED_STRING = 'EXPECTED_STRING', + EXPECTED_OBJECT = 'EXPECTED_OBJECT', + EXPECTED_ARRAY = 'EXPECTED_ARRAY', + EXPECTED_MAP = 'EXPECTED_MAP', + EXPECTED_BASE64_ENCODED_BYTE_ARRAY = 'EXPECTED_BASE64_ENCODED_BYTE_ARRAY', + INVALID_ARRAY_VALUE = 'INVALID_ARRAY_VALUE', + INVALID_ENUM_VALUE = 'INVALID_ENUM_VALUE', + INVALID_CONTENT_TYPE = 'INVALID_CONTENT_TYPE', + INVALID_FORM_VALUE = 'INVALID_FORM_VALUE', + ONE_INSTRUMENT_EXPECTED = 'ONE_INSTRUMENT_EXPECTED', + NO_FIELDS_SET = 'NO_FIELDS_SET', + DEPRECATED_FIELD_SET = 'DEPRECATED_FIELD_SET', + CARD_EXPIRED = 'CARD_EXPIRED', + INVALID_EXPIRATION = 'INVALID_EXPIRATION', + INVALID_EXPIRATION_YEAR = 'INVALID_EXPIRATION_YEAR', + INVALID_EXPIRATION_DATE = 'INVALID_EXPIRATION_DATE', + UNSUPPORTED_CARD_BRAND = 'UNSUPPORTED_CARD_BRAND', + UNSUPPORTED_ENTRY_METHOD = 'UNSUPPORTED_ENTRY_METHOD', + INVALID_ENCRYPTED_CARD = 'INVALID_ENCRYPTED_CARD', + INVALID_CARD = 'INVALID_CARD', + DELAYED_TRANSACTION_EXPIRED = 'DELAYED_TRANSACTION_EXPIRED', + DELAYED_TRANSACTION_CANCELED = 'DELAYED_TRANSACTION_CANCELED', + DELAYED_TRANSACTION_CAPTURED = 'DELAYED_TRANSACTION_CAPTURED', + DELAYED_TRANSACTION_FAILED = 'DELAYED_TRANSACTION_FAILED', + CARD_TOKEN_EXPIRED = 'CARD_TOKEN_EXPIRED', + CARD_TOKEN_USED = 'CARD_TOKEN_USED', + AMOUNT_TOO_HIGH = 'AMOUNT_TOO_HIGH', + UNSUPPORTED_INSTRUMENT_TYPE = 'UNSUPPORTED_INSTRUMENT_TYPE', + REFUND_AMOUNT_INVALID = 'REFUND_AMOUNT_INVALID', + REFUND_ALREADY_PENDING = 'REFUND_ALREADY_PENDING', + PAYMENT_NOT_REFUNDABLE = 'PAYMENT_NOT_REFUNDABLE', + INVALID_CARD_DATA = 'INVALID_CARD_DATA', + LOCATION_MISMATCH = 'LOCATION_MISMATCH', + IDEMPOTENCY_KEY_REUSED = 'IDEMPOTENCY_KEY_REUSED', + UNEXPECTED_VALUE = 'UNEXPECTED_VALUE', + SANDBOX_NOT_SUPPORTED = 'SANDBOX_NOT_SUPPORTED', + INVALID_EMAIL_ADDRESS = 'INVALID_EMAIL_ADDRESS', + INVALID_PHONE_NUMBER = 'INVALID_PHONE_NUMBER', + CHECKOUT_EXPIRED = 'CHECKOUT_EXPIRED', + BAD_CERTIFICATE = 'BAD_CERTIFICATE', + INVALID_SQUARE_VERSION_FORMAT = 'INVALID_SQUARE_VERSION_FORMAT', + API_VERSION_INCOMPATIBLE = 'API_VERSION_INCOMPATIBLE', + CARD_DECLINED = 'CARD_DECLINED', + VERIFY_CVV_FAILURE = 'VERIFY_CVV_FAILURE', + VERIFY_AVS_FAILURE = 'VERIFY_AVS_FAILURE', + CARD_DECLINED_CALL_ISSUER = 'CARD_DECLINED_CALL_ISSUER', + NOT_FOUND = 'NOT_FOUND', + APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND = 'APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND', + METHOD_NOT_ALLOWED = 'METHOD_NOT_ALLOWED', + NOT_ACCEPTABLE = 'NOT_ACCEPTABLE', + REQUEST_TIMEOUT = 'REQUEST_TIMEOUT', CONFLICT = 'CONFLICT', - REQUESTENTITYTOOLARGE = 'REQUEST_ENTITY_TOO_LARGE', - UNSUPPORTEDMEDIATYPE = 'UNSUPPORTED_MEDIA_TYPE', - RATELIMITED = 'RATE_LIMITED', - NOTIMPLEMENTED = 'NOT_IMPLEMENTED', - SERVICEUNAVAILABLE = 'SERVICE_UNAVAILABLE', - GATEWAYTIMEOUT = 'GATEWAY_TIMEOUT', + REQUEST_ENTITY_TOO_LARGE = 'REQUEST_ENTITY_TOO_LARGE', + UNSUPPORTED_MEDIA_TYPE = 'UNSUPPORTED_MEDIA_TYPE', + RATE_LIMITED = 'RATE_LIMITED', + NOT_IMPLEMENTED = 'NOT_IMPLEMENTED', + SERVICE_UNAVAILABLE = 'SERVICE_UNAVAILABLE', + GATEWAY_TIMEOUT = 'GATEWAY_TIMEOUT', } } @@ -4298,7 +4487,7 @@ export class Money { export namespace Money { export enum CurrencyEnum { - UNKNOWNCURRENCY = 'UNKNOWN_CURRENCY', + UNKNOWN_CURRENCY = 'UNKNOWN_CURRENCY', AED = 'AED', AFN = 'AFN', ALL = 'ALL', @@ -4521,12 +4710,13 @@ export class ObtainTokenRequest { export class ObtainTokenResponse { /** - * A valid OAuth access token. Provide the access token in a header with every request to Connect API endpoints. + * 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](/authz/oauth/build-with-the-api) guide for more information. */ access_token?: string; /** - * This value is always _bearer_. + * This value is always "bearer". */ token_type?: string; /** @@ -4538,7 +4728,7 @@ export class ObtainTokenResponse { */ merchant_id?: string; /** - * __Legacy field__. The ID of a subscription plan the merchant signed up for. + * @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; @@ -4561,7 +4751,8 @@ export class ObtainTokenResponse { /** * Contains all information related to a single order to process with Square, including line items that specify the - * products to purchase + * 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 { /** @@ -4581,6 +4772,10 @@ export class Order { * The origination details of the order. */ source?: OrderSource; + /** + * The [Customer](#type-customer) ID of the customer associated with the order. + */ + customer_id?: string; /** * The line items included in the order. */ @@ -4596,10 +4791,52 @@ export class Order { */ discounts?: Array; /** - * Details on order fulfillment. Orders can only be created with at most one fulfillment. However, orders returned - * by the API may contain multiple fulfillments. + * 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?: Array; + /** + * 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?: Array; + /** + * Rollup of returned money amounts. + */ + return_amounts?: OrderMoneyAmounts; + /** + * Net money amounts (sale money - return money). + */ + net_amounts?: OrderMoneyAmounts; + /** + * 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; + /** + * The Tenders which were used to pay for the Order. This field is read-only. + */ + tenders?: Array; + /** + * The Refunds that are part of this Order. This field is read-only. + */ + refunds?: Array; + /** + * Timestamp for when the order was created. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + */ + created_at?: string; + /** + * Timestamp for when the order was last updated. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + */ + updated_at?: string; + /** + * Timestamp for when the order was closed. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + */ + closed_at?: string; + /** + * The current state of the order. `OPEN`,`COMPLETED`,`CANCELED` See [OrderState](#type-orderstate) for possible values. + */ + state?: Order.StateEnum; /** * The total amount of money to collect for the order. */ @@ -4614,6 +4851,29 @@ export class Order { total_discount_money?: Money; } +export namespace Order { + export enum StateEnum { + OPEN = 'OPEN', + COMPLETED = 'COMPLETED', + CANCELED = 'CANCELED' + } +} + +/** + * 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; + /** + * The location id the Order belongs to. + */ + location_id?: string; +} + /** * Contains details on how to fulfill this order. */ @@ -4788,14 +5048,25 @@ export class OrderFulfillmentType {} * and price details. */ export class OrderLineItem { + /** + * The line item's Unique identifier, unique only within this order. This field is read-only. + */ + uid?: string; /** * The name of the line item. */ name?: string; /** - * The quantity purchased, as a string representation of a number. This string must have a positive integer value. + * The quantity purchased, formatted as a decimal number. For example: "3". + * Line items with a `quantity_unit` can have non-integer quantities. For example: "1.70000". + * Orders Hub and older versions of Connect do not support non-integer quantities. + * See [Decimal quantities with Orders hub and older versions of Connect](/more-apis/orders/overview#decimal-quantities). */ quantity: string; + /** + * The unit and precision that this line item's quantity is measured in. + */ + quantity_unit?: OrderQuantityUnit; /** * The note of the line item. */ @@ -4818,9 +5089,9 @@ export class OrderLineItem { */ taxes?: Array; /** - * A list of discounts applied to this line item. On read or retrieve, this list includes both item-level discounts - * and any order-level discounts apportioned to this item. When creating an Order, set your item-level discounts in - * this list. + * A list of discounts applied to this line item. + * On read or retrieve, this list includes both item-level discounts and any order-level discounts apportioned to this item. + * When creating an Order, set your item-level discounts in this list. */ discounts?: Array; /** @@ -4828,7 +5099,13 @@ export class OrderLineItem { */ base_price_money?: Money; /** - * The gross sales amount of money calculated as (item base price + modifiers price) * quantity. + * 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; + /** + * 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; /** @@ -4851,6 +5128,10 @@ export class OrderLineItem { * The amount distributed to each line item is relative to that item’s contribution to the order subtotal. */ export class OrderLineItemDiscount { + /** + * The discount's Unique identifier, unique only within this order. This field is read-only. + */ + uid?: string; /** * The catalog object id referencing [CatalogDiscount](#type-catalogdiscount). */ @@ -4866,8 +5147,8 @@ export class OrderLineItemDiscount { */ type?: OrderLineItemDiscount.TypeEnum; /** - * 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%. The percentage won't be set for an amount-based discount. + * 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%. The percentage won't be set for an amount-based discount. */ percentage?: string; /** @@ -4892,15 +5173,15 @@ export class OrderLineItemDiscount { export namespace OrderLineItemDiscount { export enum TypeEnum { - UNKNOWNDISCOUNT = 'UNKNOWN_DISCOUNT', - FIXEDPERCENTAGE = 'FIXED_PERCENTAGE', - FIXEDAMOUNT = 'FIXED_AMOUNT', - VARIABLEPERCENTAGE = 'VARIABLE_PERCENTAGE', - VARIABLEAMOUNT = 'VARIABLE_AMOUNT', + UNKNOWN_DISCOUNT = 'UNKNOWN_DISCOUNT', + FIXED_PERCENTAGE = 'FIXED_PERCENTAGE', + FIXED_AMOUNT = 'FIXED_AMOUNT', + VARIABLE_PERCENTAGE = 'VARIABLE_PERCENTAGE', + VARIABLE_AMOUNT = 'VARIABLE_AMOUNT', } export enum ScopeEnum { - OTHERDISCOUNTSCOPE = 'OTHER_DISCOUNT_SCOPE', - LINEITEM = 'LINE_ITEM', + OTHER_DISCOUNT_SCOPE = 'OTHER_DISCOUNT_SCOPE', + LINE_ITEM = 'LINE_ITEM', ORDER = 'ORDER', } } @@ -4919,6 +5200,10 @@ export class OrderLineItemDiscountType {} * A [CatalogModifier](#type-catalogmodifier). */ export class OrderLineItemModifier { + /** + * The modifier's Unique identifier, unique only within this order. This field is read-only. + */ + uid?: string; /** * The catalog object id referencing [CatalogModifier](#type-catalogmodifier). */ @@ -4935,7 +5220,7 @@ export class OrderLineItemModifier { base_price_money?: Money; /** * 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. + * This is the modifier's `base_price_money` multiplied by the line item's quantity. */ total_price_money?: Money; } @@ -4944,6 +5229,10 @@ export class OrderLineItemModifier { * Represents a tax that applies to one or more line items in an order. */ export class OrderLineItemTax { + /** + * The tax's Unique identifier, unique only within this order. This field is read-only. + */ + uid?: string; /** * The catalog object id referencing [CatalogTax](#type-catalogtax). */ @@ -4975,13 +5264,13 @@ export class OrderLineItemTax { export namespace OrderLineItemTax { export enum TypeEnum { - UNKNOWNTAX = 'UNKNOWN_TAX', + UNKNOWN_TAX = 'UNKNOWN_TAX', ADDITIVE = 'ADDITIVE', INCLUSIVE = 'INCLUSIVE', } export enum ScopeEnum { - OTHERTAXSCOPE = 'OTHER_TAX_SCOPE', - LINEITEM = 'LINE_ITEM', + OTHER_TAX_SCOPE = 'OTHER_TAX_SCOPE', + LINE_ITEM = 'LINE_ITEM', ORDER = 'ORDER', } } @@ -4996,6 +5285,336 @@ export class OrderLineItemTaxScope {} */ export class OrderLineItemTaxType {} +/** + * A collection of various money amounts. + */ +export class OrderMoneyAmounts { + /** + * Total money. + */ + total_money?: Money; + /** + * Money associated with taxes. + */ + tax_money?: Money; + /** + * Money associated with discounts. + */ + discount_money?: Money; + /** + * Money associated with tips. + */ + tip_money?: Money; + /** + * Money associated with service charges. + */ + service_charge_money?: Money; +} + +/** + * 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](#type-measurementunit) that represents the unit of measure for the quantity. + */ + measurement_unit?: MeasurementUnit; + /** + * 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. Orders Hub and older versions of Connect do not support non-integer quantities. + * See [Decimal quantities with Orders hub and older versions of Connect](/more-apis/orders/overview#decimal-quantities). + */ + precision?: number; +} + +/** + * The set of line items, service charges, taxes, discounts, tips, etc. being returned in an Order. + */ +export class OrderReturn { + /** + * The return's Unique identifier, unique only within this order. This field is read-only. + */ + uid?: string; + /** + * Order which contains the original sale of these returned line items. This will be unset for unlinked returns. + */ + source_order_id?: string; + /** + * Collection of line items which are being returned. + */ + return_line_items?: Array; + /** + * Collection of taxes which are being returned. + */ + return_taxes?: Array; + /** + * Collection of discounts which are being returned. + */ + return_discounts?: Array; + /** + * 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; + /** + * Aggregate monetary value being returned by this Return entry. + */ + return_amounts?: OrderMoneyAmounts; +} + +/** + * The line item discount being returned. + */ +export class OrderReturnDiscount { + /** + * The return discount's Unique identifier, unique only within this order. + */ + uid?: string; + /** + * `uid` of the Discount from the Order which contains the original application of this discount. + */ + source_discount_uid?: string; + /** + * The catalog object id referencing [CatalogDiscount](#type-catalogdiscount). + */ + catalog_object_id?: string; + /** + * The discount's name. + */ + name?: string; + /** + * The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. + * VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage + * or amount has to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. + */ + type?: OrderReturnDiscount.TypeEnum; + /** + * 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%. + * The percentage won't be set for an amount-based discount. + */ + percentage?: string; + /** + * The total monetary amount of the applicable discount. If it is at order level, it is the value of the order level discount. + * If it is at line item level, it is the value of the line item level discount. + * The amount_money won't be set for a percentage-based discount. + */ + amount_money?: Money; + /** + * 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; + /** + * 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?: OrderReturnDiscount.ScopeEnum; +} + +export namespace OrderReturnDiscount { + export enum TypeEnum { + UNKNOWN_DISCOUNT = 'UNKNOWN_DISCOUNT', + FIXED_PERCENTAGE = 'FIXED_PERCENTAGE', + FIXED_AMOUNT = 'FIXED_AMOUNT', + VARIABLE_PERCENTAGE = 'VARIABLE_PERCENTAGE', + VARIABLE_AMOUNT = 'VARIABLE_AMOUNT', + } + export enum ScopeEnum { + OTHER_DISCOUNT_SCOPE = 'OTHER_DISCOUNT_SCOPE', + LINE_ITEM = 'LINE_ITEM', + ORDER = 'ORDER', + } +} + +/** + * The line item being returned in an Order. + */ +export class OrderReturnLineItem { + /** + * Unique identifier for this return line item entry. This is a read-only field. + */ + uid?: string; + /** + * `uid` of the LineItem in the original sale Order. + */ + source_line_item_uid?: string; + /** + * The name of the line item. + */ + name?: string; + /** + * 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; + /** + * The note of the returned line item. + */ + note?: string; + /** + * The [CatalogItemVariation](#type-catalogitemvariation) id applied to this returned line item. + */ + catalog_object_id?: string; + /** + * The name of the variation applied to this returned line item. + */ + variation_name?: string; + /** + * The [CatalogModifier](#type-catalogmodifier)s applied to this line item. + */ + return_modifiers?: Array; + /** + * A list of taxes applied to this line item. On read or retrieve, this list includes both item-level taxes and any + * return-level taxes apportioned to this item. + */ + return_taxes?: Array; + /** + * A list of discounts applied to this line item. On read or retrieve, this list includes both item-level discounts + * and any return-level discounts apportioned to this item. + */ + return_discounts?: Array; + /** + * The base price for a single unit of the line item. + */ + base_price_money?: Money; + /** + * 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; + /** + * The gross return amount of money calculated as (item base price + modifiers price) * quantity. + */ + gross_return_money?: Money; + /** + * The total tax amount of money to return for the line item. + */ + total_tax_money?: Money; + /** + * The total discount amount of money to return for the line item. + */ + total_discount_money?: Money; + /** + * The total amount of money to return for this line item. + */ + total_money?: Money; +} + +/** + * A line item modifier being returned. + */ +export class OrderReturnLineItemModifier { + /** + * The return modifier's Unique identifier, unique only within this order + */ + uid?: string; + /** + * `uid` of the Modifier from the LineItem from the Order which contains the original sale of this line item modifier. + */ + source_modifier_uid?: string; + /** + * The catalog object id referencing [CatalogModifier](#type-catalogmodifier). + */ + catalog_object_id?: string; + /** + * The name of the item modifier. + */ + name?: string; + /** + * 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](#type-catalogmodifier) price. + */ + base_price_money?: Money; + /** + * 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; +} + +/** + * The line item tax being returned. + */ +export class OrderReturnTax { + /** + * The return tax's Unique identifier, unique only within this order. + */ + uid?: string; + /** + * `uid` of the Tax from the Order which contains the original charge of this tax. + */ + source_tax_uid?: string; + /** + * The catalog object id referencing [CatalogTax](#type-catalogtax). + */ + catalog_object_id?: string; + /** + * The tax's name. + */ + name?: string; + /** + * Indicates the calculation method used to apply the tax. + * See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + */ + type?: OrderReturnTax.TypeEnum; + /** + * 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?: string; + /** + * The amount of the money applied by the tax in an order. + */ + applied_money?: Money; + /** + * Indicates the level at which the tax applies. This field is set by the server. + * If set in a CreateOrder request, it will be ignored on write. + * See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values + */ + scope?: OrderReturnTax.ScopeEnum; +} + +export namespace OrderReturnTax { + export enum TypeEnum { + UNKNOWN_TAX = 'UNKNOWN_TAX', + ADDITIVE = 'ADDITIVE', + INCLUSIVE = 'INCLUSIVE', + } + export enum ScopeEnum { + OTHER_TAX_SCOPE = 'OTHER_TAX_SCOPE', + LINE_ITEM = 'LINE_ITEM', + ORDER = 'ORDER', + } +} + +/** + * 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 { + /** + * The rounding adjustment's Unique identifier, unique only within this order. This field is read-only. + */ + uid?: string; + /** + * The name of the rounding adjustment from the original sale Order. + */ + name?: string; + /** + * Actual rounding adjustment amount. + */ + amount_money?: Money; +} + /** * Represents the origination details of an order. */ @@ -5007,6 +5626,11 @@ export class OrderSource { name?: string; } +/** + * The state of the order. + */ +export class OrderState {} + /** * Indicates the Square product used to generate an inventory change. */ @@ -5393,10 +6017,10 @@ export namespace SearchCatalogObjectsRequest { ITEM = 'ITEM', IMAGE = 'IMAGE', CATEGORY = 'CATEGORY', - ITEMVARIATION = 'ITEM_VARIATION', + ITEM_VARIATION = 'ITEM_VARIATION', TAX = 'TAX', DISCOUNT = 'DISCOUNT', - MODIFIERLIST = 'MODIFIER_LIST', + MODIFIER_LIST = 'MODIFIER_LIST', MODIFIER = 'MODIFIER', } } @@ -5464,6 +6088,243 @@ export class SearchCustomersResponse { cursor?: string; } +/** + * 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 { + /** + * Filter by orders with any of the listed `customer_id`s. Max: 10 `customer_id`s. + */ + customer_ids?: Array; +} + +/** + * Filter for `Order` objects based on whether their `CREATED_AT`, `CLOSED_AT` or `UPDATED_AT` timestamps fall + * within a specified time range. You can specify the time range and which timestamp to filter for. + * You can filter for only one time range at a time. For each time range, the start time and end time are inclusive. + * If the end time is absent, it defaults to the time of the first request for the cursor. + * @important If you use the DateTimeFilter to filter for `CLOSED_AT` or `UPDATED_AT`, you must also set + * the [OrdersSort](#type-searchorderordersort). The TimeRange used in DateTimeFilter must correspond to the `sort_field` + * in the [OrdersSort](#type-searchorderordersort) object. + */ +export class SearchOrdersDateTimeFilter { + /** + * Time range for filtering on the `created_at` timestamp. + */ + created_at?: TimeRange; + /** + * Time range for filtering on the `updated_at` timestamp. + */ + updated_at?: TimeRange; + /** + * Time range for filtering on the `closed_at` timestamp. + */ + closed_at?: TimeRange; +} + +/** + * Filter options to use for a query. Multiple filters will be ANDed together. + */ +export class SearchOrdersFilter { + /** + * Filter by [`OrderState`](#type-orderstate). + */ + state_filter?: SearchOrdersStateFilter; + /** + * Filter for results within a time range. + */ + date_time_filter?: SearchOrdersDateTimeFilter; + /** + * Filter by fulfillment type or state. + */ + fulfillment_filter?: SearchOrdersFulfillmentFilter; + /** + * Filter by source of order. + */ + source_filter?: SearchOrdersSourceFilter; + /** + * Filter by customers associated with the order. + */ + customer_filter?: SearchOrdersCustomerFilter; +} + +/** + * Filter based on [Order Fulfillment](#type-orderfulfillment) information. + */ +export class SearchOrdersFulfillmentFilter { + /** + * List of [fulfillment types](#type-orderfulfillmenttype) 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: Array; + /** + * List of [fulfillment states](#type-orderfulfillmentstate) 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?: Array; +} + +export namespace SearchOrdersFulfillmentFilter { + export enum FulfillmentTypesEnum { + PICKUP = 'PICKUP', + } + export enum FulfillmentStatesEnum { + PROPOSED = 'PROPOSED', + RESERVED = 'RESERVED', + PREPARED = 'PREPARED', + COMPLETED = 'COMPLETED', + CANCELED = 'CANCELED', + FAILED = 'FAILED', + } +} + +/** + * Contains query criteria for the search. + */ +export class SearchOrdersQuery { + /** + * Criteria to filter results by. + */ + filter?: SearchOrdersFilter; + /** + * Criteria to sort results by. + */ + sort?: SearchOrdersSort; +} + +/** + * 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. The caller must have access to all provided locations. + * Min: 1 `location_ids`. Max: 10 `location_ids`. + */ + location_ids?: Array; + /** + * 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](/basics/api101/pagination) for more information. + */ + cursor?: string; + /** + * 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; + /** + * Number of results to be returned in a single page. SearchOrders may use a smaller limit than specified depending + * on server load. If the response includes a `cursor` field, you can use it to retrieve the next set of results. + * Default: `500`. + */ + limit?: number; + /** + * If set to `true`, SearchOrders will return [`OrderEntry`](#type-orderentry) objects instead of `Order` objects. + * `OrderEntry` objects are lightweight descriptions of orders that include `order_id`s. Default: `false`. + */ + return_entries?: boolean; +} + +/** + * 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](#type-orderentry) that fit the query conditions. + * Populated only if `order_entries` was set to `true` in the request. + */ + order_entries?: Array; + /** + * List of [Orders](#type-order) that match query conditions. + * Populated only if `return_entries` in the request is set to `false`. + */ + orders?: Array; + /** + * The pagination cursor to be used in a subsequent request. If unset, this is the final response. + * See [Pagination](/basics/api101/pagination) for more information. + */ + cursor?: string; + /** + * [Errors](#type-error) encountered during the search. + */ + errors?: Array; + /** + * List of transaction IDs identifying transactions that could not be converted to an `Order`. + * Empty if `return_entries` is true, however, attempts to retrieve those orders may encounter subsequent + * `unconvertible_transcation_ids` Note that this field will not be present after SearchOrders moves from BETA to GA. + */ + unconvertible_transaction_ids?: Array; +} + +/** + * Sorting options for a query. Returned Orders will always be sorted on a timestamp. + */ +export class SearchOrdersSort { + /** + * The field to sort by. + * @important When using a [DateTimeFilter](#type-searchordersfilter), `sort_field` must match the set time range field. + * If this field does not match the time range field in `DateTimeFilter`, SearchOrder will return an error. + * Default: `CREATED_AT`. See [SearchOrdersSortField](#type-searchorderssortfield) for possible values. + */ + sort_field: SearchOrdersSort.SortFieldEnum; + /** + * The order in which results are returned. Defaults to `DESC`. See [SortOrder](#type-sortorder) for possible values. + */ + sort_order?: SearchOrdersSort.SortOrderEnum; +} + +export namespace SearchOrdersSort { + export enum SortFieldEnum { + CREATED_AT = 'CREATED_AT', + UPDATED_AT = 'UPDATED_AT', + CLOSED_AT = 'CLOSED_AT', + } + export enum SortOrderEnum { + DESC = 'DESC', + ASC = 'ASC', + } +} + +/** + * Specifies which timestamp to use to sort SearchOrder results. + */ +export class SearchOrdersSortField {} + +/** + * Filter based on Order `source` information. + */ +export class SearchOrdersSourceFilter { + /** + * Filters by [Source](#type-ordersource) `name`. + * Will return any orders with with `source.name`s that match any of the listed source names. Max: 10 `source_names`. + */ + source_names?: Array; +} + +/** + * Filter by current Order `state`. + */ +export class SearchOrdersStateFilter { + /** + * States to filter for. See [OrderState](#type-orderstate) for possible values. + */ + states: Array; +} + +export namespace SearchOrdersStateFilter { + export enum StatesEnum { + OPEN = 'OPEN', + COMPLETED = 'COMPLETED', + CANCELED = 'CANCELED', + } +} + /** * A request for a filtered and sorted set of `Shift` objects. */ @@ -5640,10 +6501,10 @@ export class ShiftSort { export namespace ShiftSort { export enum FieldEnum { - STARTAT = 'START_AT', - ENDAT = 'END_AT', - CREATEDAT = 'CREATED_AT', - UPDATEDAT = 'UPDATED_AT', + START_AT = 'START_AT', + END_AT = 'END_AT', + CREATED_AT = 'CREATED_AT', + UPDATED_AT = 'UPDATED_AT', } export enum OrderEnum { DESC = 'DESC', @@ -5698,8 +6559,8 @@ export class ShiftWorkday { export namespace ShiftWorkday { export enum MatchShiftsByEnum { - STARTAT = 'START_AT', - ENDAT = 'END_AT', + START_AT = 'START_AT', + END_AT = 'END_AT', INTERSECTION = 'INTERSECTION', } } @@ -5734,15 +6595,15 @@ export class SourceApplication { export namespace SourceApplication { export enum ProductEnum { - SQUAREPOS = 'SQUARE_POS', - EXTERNALAPI = 'EXTERNAL_API', + SQUARE_POS = 'SQUARE_POS', + EXTERNAL_API = 'EXTERNAL_API', BILLING = 'BILLING', APPOINTMENTS = 'APPOINTMENTS', INVOICES = 'INVOICES', - ONLINESTORE = 'ONLINE_STORE', + ONLINE_STORE = 'ONLINE_STORE', PAYROLL = 'PAYROLL', DASHBOARD = 'DASHBOARD', - ITEMLIBRARYIMPORT = 'ITEM_LIBRARY_IMPORT', + ITEM_LIBRARY_IMPORT = 'ITEM_LIBRARY_IMPORT', OTHER = 'OTHER', } } @@ -5822,9 +6683,9 @@ export namespace Tender { export enum TypeEnum { CARD = 'CARD', CASH = 'CASH', - THIRDPARTYCARD = 'THIRD_PARTY_CARD', - SQUAREGIFTCARD = 'SQUARE_GIFT_CARD', - NOSALE = 'NO_SALE', + THIRD_PARTY_CARD = 'THIRD_PARTY_CARD', + SQUARE_GIFT_CARD = 'SQUARE_GIFT_CARD', + NO_SALE = 'NO_SALE', OTHER = 'OTHER', } } @@ -5860,7 +6721,7 @@ export namespace TenderCardDetails { SWIPED = 'SWIPED', KEYED = 'KEYED', EMV = 'EMV', - ONFILE = 'ON_FILE', + ON_FILE = 'ON_FILE', CONTACTLESS = 'CONTACTLESS', } } @@ -5965,11 +6826,11 @@ export class Transaction { export namespace Transaction { export enum ProductEnum { REGISTER = 'REGISTER', - EXTERNALAPI = 'EXTERNAL_API', + EXTERNAL_API = 'EXTERNAL_API', BILLING = 'BILLING', APPOINTMENTS = 'APPOINTMENTS', INVOICES = 'INVOICES', - ONLINESTORE = 'ONLINE_STORE', + ONLINE_STORE = 'ONLINE_STORE', PAYROLL = 'PAYROLL', OTHER = 'OTHER', } @@ -6174,16 +7035,16 @@ export class UpdateWorkweekConfigResponse { 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](/basics/api101/idempotency) for more information. + * 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](/basics/api101/idempotency) for more information. */ idempotency_key: string; /** - * A [CatalogObject](#type-catalogobject) to be created or updated. The object's `is_deleted` field must not be set - * to `true`. When creating a new object, the object's ID must either start with a `#` character or be left blank. - * In either case it will be replaced with a server-generated ID. + * A [CatalogObject](#type-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; } @@ -6225,8 +7086,8 @@ export class V1AdjustInventoryRequest { export namespace V1AdjustInventoryRequest { export enum AdjustmentTypeEnum { SALE = 'SALE', - RECEIVESTOCK = 'RECEIVE_STOCK', - MANUALADJUST = 'MANUAL_ADJUST', + RECEIVE_STOCK = 'RECEIVE_STOCK', + MANUAL_ADJUST = 'MANUAL_ADJUST', } } @@ -6278,7 +7139,7 @@ export class V1BankAccount { export namespace V1BankAccount { export enum TypeEnum { - BUSINESSCHECKING = 'BUSINESS_CHECKING', + BUSINESS_CHECKING = 'BUSINESS_CHECKING', CHECKING = 'CHECKING', INVESTMENT = 'INVESTMENT', LOAN = 'LOAN', @@ -6323,15 +7184,15 @@ export class V1CashDrawerEvent { export namespace V1CashDrawerEvent { export enum EventTypeEnum { - NOSALE = 'NO_SALE', - CASHTENDERPAYMENT = 'CASH_TENDER_PAYMENT', - OTHERTENDERPAYMENT = 'OTHER_TENDER_PAYMENT', - CASHTENDERCANCELEDPAYMENT = 'CASH_TENDER_CANCELED_PAYMENT', - OTHERTENDERCANCELEDPAYMENT = 'OTHER_TENDER_CANCELED_PAYMENT', - CASHTENDERREFUND = 'CASH_TENDER_REFUND', - OTHERTENDERREFUND = 'OTHER_TENDER_REFUND', - PAIDIN = 'PAID_IN', - PAIDOUT = 'PAID_OUT', + NO_SALE = 'NO_SALE', + CASH_TENDER_PAYMENT = 'CASH_TENDER_PAYMENT', + OTHER_TENDER_PAYMENT = 'OTHER_TENDER_PAYMENT', + CASH_TENDER_CANCELED_PAYMENT = 'CASH_TENDER_CANCELED_PAYMENT', + OTHER_TENDER_CANCELED_PAYMENT = 'OTHER_TENDER_CANCELED_PAYMENT', + CASH_TENDER_REFUND = 'CASH_TENDER_REFUND', + OTHER_TENDER_REFUND = 'OTHER_TENDER_REFUND', + PAID_IN = 'PAID_IN', + PAID_OUT = 'PAID_OUT', } } @@ -6624,8 +7485,8 @@ export class V1Discount { export namespace V1Discount { export enum DiscountTypeEnum { FIXED = 'FIXED', - VARIABLEPERCENTAGE = 'VARIABLE_PERCENTAGE', - VARIABLEAMOUNT = 'VARIABLE_AMOUNT', + VARIABLE_PERCENTAGE = 'VARIABLE_PERCENTAGE', + VARIABLE_AMOUNT = 'VARIABLE_AMOUNT', } export enum ColorEnum { _9da2a6 = '9da2a6', @@ -6731,13 +7592,13 @@ export class V1EmployeeRole { export namespace V1EmployeeRole { export enum PermissionsEnum { - ACCESSSALESHISTORY = 'REGISTER_ACCESS_SALES_HISTORY', - APPLYRESTRICTEDDISCOUNTS = 'REGISTER_APPLY_RESTRICTED_DISCOUNTS', - CHANGESETTINGS = 'REGISTER_CHANGE_SETTINGS', - EDITITEM = 'REGISTER_EDIT_ITEM', - ISSUEREFUNDS = 'REGISTER_ISSUE_REFUNDS', - OPENCASHDRAWEROUTSIDESALE = 'REGISTER_OPEN_CASH_DRAWER_OUTSIDE_SALE', - VIEWSUMMARYREPORTS = 'REGISTER_VIEW_SUMMARY_REPORTS', + REGISTER_ACCESS_SALES_HISTORY = 'REGISTER_ACCESS_SALES_HISTORY', + REGISTER_APPLY_RESTRICTED_DISCOUNTS = 'REGISTER_APPLY_RESTRICTED_DISCOUNTS', + REGISTER_CHANGE_SETTINGS = 'REGISTER_CHANGE_SETTINGS', + REGISTER_EDIT_ITEM = 'REGISTER_EDIT_ITEM', + REGISTER_ISSUE_REFUNDS = 'REGISTER_ISSUE_REFUNDS', + REGISTER_OPEN_CASH_DRAWER_OUTSIDE_SALE = 'REGISTER_OPEN_CASH_DRAWER_OUTSIDE_SALE', + REGISTER_VIEW_SUMMARY_REPORTS = 'REGISTER_VIEW_SUMMARY_REPORTS', } } @@ -6795,9 +7656,9 @@ export class V1Fee { export namespace V1Fee { export enum CalculationPhaseEnum { - FEESUBTOTALPHASE = 'FEE_SUBTOTAL_PHASE', + FEE_SUBTOTAL_PHASE = 'FEE_SUBTOTAL_PHASE', OTHER = 'OTHER', - FEETOTALPHASE = 'FEE_TOTAL_PHASE', + FEE_TOTAL_PHASE = 'FEE_TOTAL_PHASE', } export enum AdjustmentTypeEnum { TAX = 'TAX', @@ -6807,13 +7668,13 @@ export namespace V1Fee { INCLUSIVE = 'INCLUSIVE', } export enum TypeEnum { - CAGST = 'CA_GST', - CAHST = 'CA_HST', - CAPST = 'CA_PST', - CAQST = 'CA_QST', - JPCONSUMPTIONTAX = 'JP_CONSUMPTION_TAX', - CAPEIPST = 'CA_PEI_PST', - USSALESTAX = 'US_SALES_TAX', + CA_GST = 'CA_GST', + CA_HST = 'CA_HST', + CA_PST = 'CA_PST', + CA_QST = 'CA_QST', + JP_CONSUMPTION_TAX = 'JP_CONSUMPTION_TAX', + CA_PEI_PST = 'CA_PEI_PST', + US_SALES_TAX = 'US_SALES_TAX', OTHER = 'OTHER', } } @@ -6920,7 +7781,7 @@ export class V1Item { export namespace V1Item { export enum TypeEnum { NORMAL = 'NORMAL', - GIFTCARD = 'GIFT_CARD', + GIFT_CARD = 'GIFT_CARD', OTHER = 'OTHER', } export enum ColorEnum { @@ -7440,55 +8301,55 @@ export namespace V1Merchant { } export enum BusinessTypeEnum { ACCOUNTING = 'ACCOUNTING', - APPARELANDACCESSORYSHOPS = 'APPAREL_AND_ACCESSORY_SHOPS', - ARTDEALERSGALLERIES = 'ART_DEALERS_GALLERIES', - ARTDESIGNANDPHOTOGRAPHY = 'ART_DESIGN_AND_PHOTOGRAPHY', - BARCLUBLOUNGE = 'BAR_CLUB_LOUNGE', - BEAUTYANDBARBERSHOPS = 'BEAUTY_AND_BARBER_SHOPS', - BOOKSTORES = 'BOOK_STORES', - BUSINESSSERVICES = 'BUSINESS_SERVICES', + APPAREL_AND_ACCESSORY_SHOPS = 'APPAREL_AND_ACCESSORY_SHOPS', + ART_DEALERS_GALLERIES = 'ART_DEALERS_GALLERIES', + ART_DESIGN_AND_PHOTOGRAPHY = 'ART_DESIGN_AND_PHOTOGRAPHY', + BAR_CLUB_LOUNGE = 'BAR_CLUB_LOUNGE', + BEAUTY_AND_BARBER_SHOPS = 'BEAUTY_AND_BARBER_SHOPS', + BOOK_STORES = 'BOOK_STORES', + BUSINESS_SERVICES = 'BUSINESS_SERVICES', CATERING = 'CATERING', - CHARITABLESOCIALSERVICEORGANIZATIONS = 'CHARITABLE_SOCIAL_SERVICE_ORGANIZATIONS', - CHARITIBLEORGS = 'CHARITIBLE_ORGS', - CLEANINGSERVICES = 'CLEANING_SERVICES', - COMPUTEREQUIPMENTSOFTWAREMAINTENANCEREPAIRSERVICES = 'COMPUTER_EQUIPMENT_SOFTWARE_MAINTENANCE_REPAIR_SERVICES', + CHARITABLE_SOCIAL_SERVICE_ORGANIZATIONS = 'CHARITABLE_SOCIAL_SERVICE_ORGANIZATIONS', + CHARITIBLE_ORGS = 'CHARITIBLE_ORGS', + CLEANING_SERVICES = 'CLEANING_SERVICES', + COMPUTER_EQUIPMENT_SOFTWARE_MAINTENANCE_REPAIR_SERVICES = 'COMPUTER_EQUIPMENT_SOFTWARE_MAINTENANCE_REPAIR_SERVICES', CONSULTANT = 'CONSULTANT', CONTRACTORS = 'CONTRACTORS', - DELIVERYSERVICES = 'DELIVERY_SERVICES', + DELIVERY_SERVICES = 'DELIVERY_SERVICES', DENTISTRY = 'DENTISTRY', EDUCATION = 'EDUCATION', - FOODSTORESCONVENIENCESTORESANDSPECIALTYMARKETS = 'FOOD_STORES_CONVENIENCE_STORES_AND_SPECIALTY_MARKETS', - FOODTRUCKCART = 'FOOD_TRUCK_CART', - FURNITUREHOMEANDOFFICEEQUIPMENT = 'FURNITURE_HOME_AND_OFFICE_EQUIPMENT', - FURNITUREHOMEGOODS = 'FURNITURE_HOME_GOODS', - HOTELSANDLODGING = 'HOTELS_AND_LODGING', - INDIVIDUALUSE = 'INDIVIDUAL_USE', - JEWELRYANDWATCHES = 'JEWELRY_AND_WATCHES', - LANDSCAPINGANDHORTICULTURALSERVICES = 'LANDSCAPING_AND_HORTICULTURAL_SERVICES', - LANGUAGESCHOOLS = 'LANGUAGE_SCHOOLS', - LEGALSERVICES = 'LEGAL_SERVICES', - MEDICALPRACTITIONERS = 'MEDICAL_PRACTITIONERS', - MEDICALSERVICESANDHEALTHPRACTITIONERS = 'MEDICAL_SERVICES_AND_HEALTH_PRACTITIONERS', - MEMBERSHIPORGANIZATIONS = 'MEMBERSHIP_ORGANIZATIONS', - MUSICANDENTERTAINMENT = 'MUSIC_AND_ENTERTAINMENT', + FOOD_STORES_CONVENIENCE_STORES_AND_SPECIALTY_MARKETS = 'FOOD_STORES_CONVENIENCE_STORES_AND_SPECIALTY_MARKETS', + FOOD_TRUCK_CART = 'FOOD_TRUCK_CART', + FURNITURE_HOME_AND_OFFICE_EQUIPMENT = 'FURNITURE_HOME_AND_OFFICE_EQUIPMENT', + FURNITURE_HOME_GOODS = 'FURNITURE_HOME_GOODS', + HOTELS_AND_LODGING = 'HOTELS_AND_LODGING', + INDIVIDUAL_USE = 'INDIVIDUAL_USE', + JEWELRY_AND_WATCHES = 'JEWELRY_AND_WATCHES', + LANDSCAPING_AND_HORTICULTURAL_SERVICES = 'LANDSCAPING_AND_HORTICULTURAL_SERVICES', + LANGUAGE_SCHOOLS = 'LANGUAGE_SCHOOLS', + LEGAL_SERVICES = 'LEGAL_SERVICES', + MEDICAL_PRACTITIONERS = 'MEDICAL_PRACTITIONERS', + MEDICAL_SERVICES_AND_HEALTH_PRACTITIONERS = 'MEDICAL_SERVICES_AND_HEALTH_PRACTITIONERS', + MEMBERSHIP_ORGANIZATIONS = 'MEMBERSHIP_ORGANIZATIONS', + MUSIC_AND_ENTERTAINMENT = 'MUSIC_AND_ENTERTAINMENT', OTHER = 'OTHER', - OUTDOORMARKETS = 'OUTDOOR_MARKETS', - PERSONALSERVICES = 'PERSONAL_SERVICES', - POLITICALORGANIZATIONS = 'POLITICAL_ORGANIZATIONS', - PROFESSIONALSERVICES = 'PROFESSIONAL_SERVICES', - REALESTATE = 'REAL_ESTATE', - RECREATIONSERVICES = 'RECREATION_SERVICES', - REPAIRSHOPSANDRELATEDSERVICES = 'REPAIR_SHOPS_AND_RELATED_SERVICES', + OUTDOOR_MARKETS = 'OUTDOOR_MARKETS', + PERSONAL_SERVICES = 'PERSONAL_SERVICES', + POLITICAL_ORGANIZATIONS = 'POLITICAL_ORGANIZATIONS', + PROFESSIONAL_SERVICES = 'PROFESSIONAL_SERVICES', + REAL_ESTATE = 'REAL_ESTATE', + RECREATION_SERVICES = 'RECREATION_SERVICES', + REPAIR_SHOPS_AND_RELATED_SERVICES = 'REPAIR_SHOPS_AND_RELATED_SERVICES', RESTAURANTS = 'RESTAURANTS', - RETAILSHOPS = 'RETAIL_SHOPS', - SCHOOLSANDEDUCATIONALSERVICES = 'SCHOOLS_AND_EDUCATIONAL_SERVICES', - SPORTINGGOODS = 'SPORTING_GOODS', - TAXICABSANDLIMOUSINES = 'TAXICABS_AND_LIMOUSINES', - TICKETSALES = 'TICKET_SALES', + RETAIL_SHOPS = 'RETAIL_SHOPS', + SCHOOLS_AND_EDUCATIONAL_SERVICES = 'SCHOOLS_AND_EDUCATIONAL_SERVICES', + SPORTING_GOODS = 'SPORTING_GOODS', + TAXICABS_AND_LIMOUSINES = 'TAXICABS_AND_LIMOUSINES', + TICKET_SALES = 'TICKET_SALES', TOURISM = 'TOURISM', - TRAVELTOURISM = 'TRAVEL_TOURISM', - VETERINARYSERVICES = 'VETERINARY_SERVICES', - WEBDEVDESIGN = 'WEB_DEV_DESIGN', + TRAVEL_TOURISM = 'TRAVEL_TOURISM', + VETERINARY_SERVICES = 'VETERINARY_SERVICES', + WEB_DEV_DESIGN = 'WEB_DEV_DESIGN', } } @@ -7593,7 +8454,7 @@ export class V1Money { export namespace V1Money { export enum CurrencyCodeEnum { - UNKNOWNCURRENCY = 'UNKNOWN_CURRENCY', + UNKNOWN_CURRENCY = 'UNKNOWN_CURRENCY', AED = 'AED', AFN = 'AFN', ALL = 'ALL', @@ -7910,9 +8771,9 @@ export class V1OrderHistoryEntry { export namespace V1OrderHistoryEntry { export enum ActionEnum { - ORDERPLACED = 'ORDER_PLACED', + ORDER_PLACED = 'ORDER_PLACED', DECLINED = 'DECLINED', - PAYMENTRECEIVED = 'PAYMENT_RECEIVED', + PAYMENT_RECEIVED = 'PAYMENT_RECEIVED', CANCELED = 'CANCELED', COMPLETED = 'COMPLETED', REFUNDED = 'REFUNDED', @@ -7987,9 +8848,9 @@ export namespace V1PageCell { PLACEHOLDER = 'PLACEHOLDER', } export enum PlaceholderTypeEnum { - ALLITEMS = 'ALL_ITEMS', - DISCOUNTSCATEGORY = 'DISCOUNTS_CATEGORY', - REWARDSFINDER = 'REWARDS_FINDER', + ALL_ITEMS = 'ALL_ITEMS', + DISCOUNTS_CATEGORY = 'DISCOUNTS_CATEGORY', + REWARDS_FINDER = 'REWARDS_FINDER', } } @@ -8237,10 +9098,10 @@ export class V1PaymentItemization { export namespace V1PaymentItemization { export enum ItemizationTypeEnum { ITEM = 'ITEM', - CUSTOMAMOUNT = 'CUSTOM_AMOUNT', - GIFTCARDACTIVATION = 'GIFT_CARD_ACTIVATION', - GIFTCARDRELOAD = 'GIFT_CARD_RELOAD', - GIFTCARDUNKNOWN = 'GIFT_CARD_UNKNOWN', + CUSTOM_AMOUNT = 'CUSTOM_AMOUNT', + GIFT_CARD_ACTIVATION = 'GIFT_CARD_ACTIVATION', + GIFT_CARD_RELOAD = 'GIFT_CARD_RELOAD', + GIFT_CARD_UNKNOWN = 'GIFT_CARD_UNKNOWN', OTHER = 'OTHER', } } @@ -8310,7 +9171,7 @@ export class V1PaymentSurcharge { export namespace V1PaymentSurcharge { export enum TypeEnum { UNKNOWN = 'UNKNOWN', - AUTOGRATUITY = 'AUTO_GRATUITY', + AUTO_GRATUITY = 'AUTO_GRATUITY', CUSTOM = 'CUSTOM', } } @@ -8548,26 +9409,26 @@ export class V1SettlementEntry { export namespace V1SettlementEntry { export enum TypeEnum { ADJUSTMENT = 'ADJUSTMENT', - BALANCECHARGE = 'BALANCE_CHARGE', + BALANCE_CHARGE = 'BALANCE_CHARGE', CHARGE = 'CHARGE', - FREEPROCESSING = 'FREE_PROCESSING', - HOLDADJUSTMENT = 'HOLD_ADJUSTMENT', - PAIDSERVICEFEE = 'PAID_SERVICE_FEE', - PAIDSERVICEFEEREFUND = 'PAID_SERVICE_FEE_REFUND', - REDEMPTIONCODE = 'REDEMPTION_CODE', + FREE_PROCESSING = 'FREE_PROCESSING', + HOLD_ADJUSTMENT = 'HOLD_ADJUSTMENT', + PAID_SERVICE_FEE = 'PAID_SERVICE_FEE', + PAID_SERVICE_FEE_REFUND = 'PAID_SERVICE_FEE_REFUND', + REDEMPTION_CODE = 'REDEMPTION_CODE', REFUND = 'REFUND', - RETURNEDPAYOUT = 'RETURNED_PAYOUT', - SQUARECAPITALADVANCE = 'SQUARE_CAPITAL_ADVANCE', - SQUARECAPITALPAYMENT = 'SQUARE_CAPITAL_PAYMENT', - SQUARECAPITALREVERSEDPAYMENT = 'SQUARE_CAPITAL_REVERSED_PAYMENT', - SUBSCRIPTIONFEE = 'SUBSCRIPTION_FEE', - SUBSCRIPTIONFEEREFUND = 'SUBSCRIPTION_FEE_REFUND', + RETURNED_PAYOUT = 'RETURNED_PAYOUT', + SQUARE_CAPITAL_ADVANCE = 'SQUARE_CAPITAL_ADVANCE', + SQUARE_CAPITAL_PAYMENT = 'SQUARE_CAPITAL_PAYMENT', + SQUARE_CAPITAL_REVERSED_PAYMENT = 'SQUARE_CAPITAL_REVERSED_PAYMENT', + SUBSCRIPTION_FEE = 'SUBSCRIPTION_FEE', + SUBSCRIPTION_FEE_REFUND = 'SUBSCRIPTION_FEE_REFUND', OTHER = 'OTHER', - INCENTEDPAYMENT = 'INCENTED_PAYMENT', - RETURNEDACHENTRY = 'RETURNED_ACH_ENTRY', - RETURNEDSQUARE275 = 'RETURNED_SQUARE_275', - SQUARE275 = 'SQUARE_275', - SQUARECARD = 'SQUARE_CARD', + INCENTED_PAYMENT = 'INCENTED_PAYMENT', + RETURNED_ACH_ENTRY = 'RETURNED_ACH_ENTRY', + RETURNED_SQUARE_275 = 'RETURNED_SQUARE_275', + SQUARE_275 = 'SQUARE_275', + SQUARE_CARD = 'SQUARE_CARD', } } @@ -8577,16 +9438,16 @@ export class V1SettlementStatus {} /** * A tender represents a discrete monetary exchange. Square represents this exchange as a money object with a specific - * currency and amount, where the amount is given in the smallest denomination of the given currency. Square POS can - * accept more than one form of tender for a single payment (such as by splitting a bill between a credit card and a - * gift card). The `tender` field of the Payment object lists all forms of tender used for the payment. Split tender - * payments behave slightly differently from single tender payments: The receipt_url for a split tender corresponds - * only to the first tender listed in the tender field. To get the receipt URLs for the remaining tenders, use the - * receipt_url fields of the corresponding Tender objects. *A note on gift cards**: when a customer purchases a Square - * gift card from a merchant, the merchant receives the full amount of the gift card in the associated payment. When - * that gift card is used as a tender, the balance of the gift card is reduced and the merchant receives no funds. A - * `Tender` object with a type of `SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the associated - * payment. + * currency and amount, where the amount is given in the smallest denomination of the given currency. + * Square POS can accept more than one form of tender for a single payment (such as by splitting a bill between a credit + * card and a gift card). The `tender` field of the Payment object lists all forms of tender used for the payment. + * Split tender payments behave slightly differently from single tender payments: + * The receipt_url for a split tender corresponds only to the first tender listed in the tender field. + * To get the receipt URLs for the remaining tenders, use the receipt_url fields of the corresponding Tender objects. + * *A note on gift cards**: when a customer purchases a Square gift card from a merchant, the merchant receives the + * full amount of the gift card in the associated payment. + * When that gift card is used as a tender, the balance of the gift card is reduced and the merchant receives no funds. + * A `Tender` object with a type of `SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the associated payment. */ export class V1Tender { /** @@ -8610,7 +9471,7 @@ export class V1Tender { */ receipt_url?: string; /** - * The brand of credit card provided. See [CardBrand](#type-cardbrand) for possible values + * The brand of credit card provided. See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values. */ card_brand?: V1Tender.CardBrandEnum; /** @@ -8618,12 +9479,12 @@ export class V1Tender { */ pan_suffix?: string; /** - * The tender's unique ID. See [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible values + * The tender's unique ID. See [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible values. */ entry_method?: V1Tender.EntryMethodEnum; /** - * Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender - * with the type: OTHER. + * Notes entered by the merchant about the tender at the time of payment, if any. + * Typically only present for tender with the type: OTHER. */ payment_note?: string; /** @@ -8660,37 +9521,42 @@ export class V1Tender { export namespace V1Tender { export enum TypeEnum { - CREDITCARD = 'CREDIT_CARD', + CREDIT_CARD = 'CREDIT_CARD', CASH = 'CASH', - THIRDPARTYCARD = 'THIRD_PARTY_CARD', - NOSALE = 'NO_SALE', - SQUAREWALLET = 'SQUARE_WALLET', - SQUAREGIFTCARD = 'SQUARE_GIFT_CARD', + THIRD_PARTY_CARD = 'THIRD_PARTY_CARD', + NO_SALE = 'NO_SALE', + SQUARE_WALLET = 'SQUARE_WALLET', + SQUARE_GIFT_CARD = 'SQUARE_GIFT_CARD', UNKNOWN = 'UNKNOWN', OTHER = 'OTHER', } export enum CardBrandEnum { - OTHERBRAND = 'OTHER_BRAND', + OTHER_BRAND = 'OTHER_BRAND', VISA = 'VISA', MASTERCARD = 'MASTERCARD', - AMERICANEXPRESS = 'AMERICAN_EXPRESS', + AMERICAN_EXPRESS = 'AMERICAN_EXPRESS', DISCOVER = 'DISCOVER', - DISCOVERDINERS = 'DISCOVER_DINERS', + DISCOVER_DINERS = 'DISCOVER_DINERS', JCB = 'JCB', - CHINAUNIONPAY = 'CHINA_UNIONPAY', - SQUAREGIFTCARD = 'SQUARE_GIFT_CARD', + CHINA_UNIONPAY = 'CHINA_UNIONPAY', + SQUARE_GIFT_CARD = 'SQUARE_GIFT_CARD', } export enum EntryMethodEnum { MANUAL = 'MANUAL', SCANNED = 'SCANNED', - SQUARECASH = 'SQUARE_CASH', - SQUAREWALLET = 'SQUARE_WALLET', + SQUARE_CASH = 'SQUARE_CASH', + SQUARE_WALLET = 'SQUARE_WALLET', SWIPED = 'SWIPED', - WEBFORM = 'WEB_FORM', + WEB_FORM = 'WEB_FORM', OTHER = 'OTHER', } } +/** + * The brand of a credit card. + */ +export class V1TenderCardBrand {} + export class V1TenderEntryMethod {} export class V1TenderType {} @@ -8781,14 +9647,14 @@ export class V1TimecardEvent { export namespace V1TimecardEvent { export enum EventTypeEnum { - APICREATE = 'API_CREATE', - APIEDIT = 'API_EDIT', - APIDELETE = 'API_DELETE', - REGISTERCLOCKIN = 'REGISTER_CLOCKIN', - REGISTERCLOCKOUT = 'REGISTER_CLOCKOUT', - DASHBOARDSUPERVISORCLOSE = 'DASHBOARD_SUPERVISOR_CLOSE', - DASHBOARDEDIT = 'DASHBOARD_EDIT', - DASHBOARDDELETE = 'DASHBOARD_DELETE', + API_CREATE = 'API_CREATE', + API_EDIT = 'API_EDIT', + API_DELETE = 'API_DELETE', + REGISTER_CLOCKIN = 'REGISTER_CLOCKIN', + REGISTER_CLOCKOUT = 'REGISTER_CLOCKOUT', + DASHBOARD_SUPERVISOR_CLOSE = 'DASHBOARD_SUPERVISOR_CLOSE', + DASHBOARD_EDIT = 'DASHBOARD_EDIT', + DASHBOARD_DELETE = 'DASHBOARD_DELETE', } } /** @@ -9002,11 +9868,11 @@ export class V1Variation { export namespace V1Variation { export enum PricingTypeEnum { - FIXEDPRICING = 'FIXED_PRICING', - VARIABLEPRICING = 'VARIABLE_PRICING', + FIXED_PRICING = 'FIXED_PRICING', + VARIABLE_PRICING = 'VARIABLE_PRICING', } export enum InventoryAlertTypeEnum { - LOWQUANTITY = 'LOW_QUANTITY', + LOW_QUANTITY = 'LOW_QUANTITY', NONE = 'NONE', INVESTMENT = 'INVESTMENT', LOAN = 'LOAN', @@ -9084,6 +9950,33 @@ export namespace WorkweekConfig { } } +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: Record; + /** + * The default HTTP headers to be included for all API calls. + */ + defaultHeaders: Record; + /** + * 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; +} + export class ApplePayApi { /** * Activates a domain for use with Web Apple Pay and Square. @@ -9187,8 +10080,9 @@ export class CustomersApi { */ createCustomerCard(params: 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. + * 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(params: DeleteCustomerRequest): Promise; /** @@ -9235,8 +10129,62 @@ export class OrdersApi { createOrder(params: CreateOrderRequest): Promise; } +export class EmployeesApi { + /** + * 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; +} + +export class InventoryApi { + /** + * 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(params: BatchChangeInventoryRequest): 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(params: BatchRetrieveInventoryChangesRequest): 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(params: BatchRetrieveInventoryCountsRequest): Promise; + /** + * Returns the [InventoryAdjustment](#type-inventoryadjustment) object with the provided `adjustment_id`. + */ + retrieveInventoryAdjustment(...args: Array): 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: Array): 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: Array): Promise; + /** + * Returns the [InventoryPhysicalCount](#type-inventoryphysicalcount) object with the provided `physical_count_id`. + */ + retrieveInventoryPhysicalCount(...args: Array): Promise; +} + // TBU... -export class EmployeesApi {} export class LaborApi {} export class MobileAuthorizationApi {} export class OAuthApi {}